{"id":15601,"library":"ember-cli-funnel","title":"Ember CLI Funnel - File Exclusion","description":"`ember-cli-funnel` is an Ember CLI addon designed to exclude specific files or directories from an Ember application's build output. It integrates directly into the `ember-cli-build.js` file, allowing developers to define exclusion patterns using glob syntax within the `EmberApp` configuration. The current stable version, 0.6.1, suggests it's still in a pre-1.0 development phase, implying that its API might not be fully stable, though the core functionality of file funnelling via Broccoli is well-established. Its release cadence appears to be driven by contributions and maintenance, as indicated by a recent dependency update in September 2023 despite the low version number. Key differentiators include its straightforward configuration within the standard Ember build process and its ability to dynamically exclude files based on environment variables or Git branch information, providing fine-grained control over the final build artifact size and content for different deployment targets.","status":"maintenance","version":"0.6.1","language":"javascript","source_language":"en","source_url":"https://github.com/kellyselden/ember-cli-funnel","tags":["javascript","broccoli","ember-addon","funnel"],"install":[{"cmd":"npm install ember-cli-funnel","lang":"bash","label":"npm"},{"cmd":"yarn add ember-cli-funnel","lang":"bash","label":"yarn"},{"cmd":"pnpm add ember-cli-funnel","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"`ember-cli-build.js` files, where `ember-cli-funnel` is configured, traditionally use CommonJS `require` syntax. The addon's functionality is activated by passing a `funnel` option to the `EmberApp` constructor.","wrong":"import EmberApp from 'ember-cli/lib/broccoli/ember-app';","symbol":"EmberApp","correct":"const EmberApp = require('ember-cli/lib/broccoli/ember-app');"},{"note":"The `funnel` property is a specific configuration object understood by the `ember-cli-funnel` addon when present in the `EmberApp` options. It is not a standalone module to be imported directly into your JavaScript files.","wrong":"import funnel from 'ember-cli-funnel';","symbol":"funnel (configuration option)","correct":"let app = new EmberApp(defaults, { funnel: { exclude: ['some/path/**/*'] } });"},{"note":"For advanced dynamic exclusions based on Git repository information, `git-repo-info` is an external development dependency that is `require`d in `ember-cli-build.js`.","wrong":"import getRepoInfo from 'git-repo-info';","symbol":"getRepoInfo (from git-repo-info)","correct":"let getRepoInfo = require('git-repo-info');"}],"quickstart":{"code":"// ember-cli-build.js\n'use strict';\n\nconst EmberApp = require('ember-cli/lib/broccoli/ember-app');\nconst path = require('path');\n\nmodule.exports = function(defaults) {\n  let app = new EmberApp(defaults, {\n    // Configure ember-cli-funnel to exclude specific files from the build\n    funnel: {\n      // Array of glob patterns for files/directories to exclude\n      exclude: [\n        // Exclude an entire route folder named 'style-guide' from the app's output\n        `${defaults.project.pkg.name}/routes/style-guide/**/*`,\n        // Exclude SCSS files from a specific addon's tree output\n        'addon-tree-output/some-addon/styles/**/*.scss'\n      ],\n      // The 'enabled' option defaults to true only in production. \n      // Explicitly enable it for other environments if needed.\n      enabled: process.env.EMBER_ENV === 'development' || process.env.EMBER_ENV === 'production'\n    }\n  });\n\n  // Return the final Broccoli tree for the build process\n  return app.toTree();\n};","lang":"javascript","description":"This quickstart demonstrates how to configure `ember-cli-funnel` within `ember-cli-build.js` to exclude specific application routes and addon styles from the final build output based on glob patterns and environment."},"warnings":[{"fix":"Explicitly set `enabled: true` within the `funnel` configuration object in `ember-cli-build.js`: `funnel: { enabled: true, exclude: [...] }`.","message":"The `enabled` option for `funnel` defaults to `true` only in `production` environments. If you intend to use file exclusion in `development`, `test`, or other non-production environments, you must explicitly set `enabled: true` in your `ember-cli-build.js` configuration.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Refer to the project's GitHub releases or changelog for specific breaking changes if upgrading within the 0.x range. It is advisable to pin exact versions (e.g., `\"ember-cli-funnel\": \"0.6.1\"`) for stability to avoid unexpected breaking changes.","message":"As a pre-1.0 release (version 0.6.1), the API and configuration options for `ember-cli-funnel` may be subject to backward-incompatible changes in future minor or patch releases, although no specific breaking changes are documented in the provided README. Developers should be cautious when upgrading within the 0.x range.","severity":"breaking","affected_versions":"<1.0.0"},{"fix":"Thoroughly test exclusion patterns by running `ember serve` and inspecting the `dist/` directory. Use tools like `glob-explorer` or `tree` to visualize path matching. Pay close attention to the distinction between application-specific file paths and those residing within the `addon-tree-output` directory.","message":"Incorrectly defined glob patterns in the `exclude` array can lead to unexpected files being included or excluded, potentially causing runtime errors, build failures, or bloating the build output. Paths are typically relative to the project root or the `addon-tree-output` for files originating from other addons.","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"last_verified":"2026-04-21T00:00:00.000Z","next_check":"2026-07-20T00:00:00.000Z","problems":[{"fix":"`ember-cli-funnel` is an Ember CLI addon that extends the `EmberApp` build options. It is not directly imported into JavaScript files. Ensure it is listed in your `package.json` and that `ember install ember-cli-funnel` has been run.","cause":"Attempting to `require` or `import` `ember-cli-funnel` directly into an application JavaScript file or even `ember-cli-build.js`.","error":"Error: Cannot find module 'ember-cli-funnel'"},{"fix":"To apply file exclusions in development or other environments, you must explicitly set `enabled: true` in your `ember-cli-build.js` configuration: `funnel: { enabled: true, exclude: [...] }`.","cause":"The `funnel.enabled` option defaults to `true` only in the production environment to optimize development build times.","error":"My files aren't being excluded in development! (or other non-production environments)"},{"fix":"Check the `ember-cli-funnel` GitHub issues and pull requests for any known compatibility issues or updates required for your specific Ember CLI and Node.js versions. Consider using `ember try:each` to test against multiple Ember versions to identify the breaking point.","cause":"The package, being pre-1.0 and supporting older Node.js engines (`6.* || 8.* || >= 10.*`), may have underlying Broccoli dependencies or integration mechanisms with `EmberApp` that are not fully compatible with newer Ember CLI or Node.js versions without updates.","error":"Build fails or includes unexpected files after upgrading Ember CLI or Node.js versions."}],"ecosystem":"npm"}