How not to include mock services in Angular2 production bundle
|Added at||2016-12-29 23:12|
When building an angular 2 app for production we use
But our mock services also get bundled and minified probably because we have
and that prevents the tree shaking from dropping the unused service. Here is our simplified app.module.ts which conditionally lazy-loads the mock service when environment.mock=true
I would imagine this is a pretty common scenario but I can't find any answers for it.
Thanks in advance and happy holidays! :-)