Short Explanation:
How to exclude all component.hbs, component.hbs.js and this.route('component) mention in router.js related to a component while ember build.
Long Explanation:
Think that you have a component in your ember app which you want to be available only in the development environment (lets not worry about how good this approach is, for now!!) and must be removed while building for production.
I have tried a few ember-cli plugins (broccoli-funnel, ember-cli-funnel) which excludes component.hbs.js file but I can still see the references to the component.hbs and this.route('component') in the compiled JS file in /dist folder.
You have multiple options:
Great addon: https://github.com/kategengler/ember-feature-flags
As mentioned by pedro, you could checkout
ember-composable-helpersfor that. They seem to strip the files inindex.js#treeForAddon. https://github.com/DockYard/ember-composable-helpers/blob/master/index.js#L28-L33This might also help: Place to put assets for dev/test in emberjs
Might be a bit more complicated... you could checkout how Ember does it with their Feature Flags (although, I'm not sure if they use
defeatureifyorbabel-plugin-filter-imports) * Ember Feature Flags: https://guides.emberjs.com/release/configuring-ember/feature-flags/Defeatureify: https://github.com/thomasboyt/defeatureify/
https://github.com/ember-cli/babel-plugin-filter-imports
Hope this helps!