Exclude files from an ember build
ember install ember-cli-funnel
// ember-cli-build.js
let app = new EmberApp(defaults, {
funnel: {
exclude: [
`${defaults.project.pkg.name}/routes/style-guide/**/*`,
'addon-tree-output/some-addon/styles/**/*.scss'
]
}
});
enabled
(bool): defaults to only in productionexclude
(array of globs): defaults to empty array
Exclude route files and router definitions from the master
branch build
ember install ember-git-version
npm install git-repo-info --save-dev
// ember-cli-build.js
let getRepoInfo = require('git-repo-info');
let info = getRepoInfo();
let app = new EmberApp(defaults, {
funnel: {
enabled: info.branch === 'master',
exclude: [`${defaults.project.pkg.name}/routes/style-guide/**/*`]
}
});
// app/router.js
if (config.branch !== 'master') {
this.route('style-guide', function() {
// ...
});
}
Exclude different files for different environments
// ember-cli-build.js
let exclude = [];
switch (EmberApp.env()) {
case 'development':
exclude.push(`${defaults.project.pkg.name}/routes/prod-only/**/*`);
break;
case 'production':
exclude.push(`${defaults.project.pkg.name}/routes/dev-only/**/*`);
break;
}
let app = new EmberApp(defaults, {
funnel: {
enabled: true,
exclude
}
});
git clone <repository-url>
cd ember-cli-funnel
npm install
npm run lint:js
npm run lint:js -- --fix
ember test
– Runs the test suite on the current Ember versionember test --server
– Runs the test suite in "watch mode"ember try:each
– Runs the test suite against multiple Ember versions
ember serve
- Visit the dummy application at http://localhost:4200.
For more information on using ember-cli, visit https://ember-cli.com/.
This project is licensed under the MIT License.