Ember CLI Node Assets is an Ember CLI addon designed to simplify the inclusion of stylesheets, images, and JavaScript assets directly from npm packages into Ember applications and other Ember addons. As of its last major update, v0.2.2, released in 2020, the package appears to be in an abandoned state with no recent maintenance or updates. Its primary function is to funnel specified files from an npm package into an Ember application's `vendor` (for `app.import` consumption) or `public` (for direct public access) directories during the build process. It differentiates itself by providing a consistent configuration API, handling npm package layout variations (npm 2 vs 3), and abstracting away direct interaction with Broccoli plugins, which are the underlying build tools for Ember CLI. It encourages a pattern of explicitly funneling assets rather than implicit imports, allowing for fine-grained control over asset placement and inclusion.
npm install ember-cli-node-assetsVerified import paths — ran on the pinned version, not inferred.
This example demonstrates how to configure `ember-cli-node-assets` in an Ember application's `ember-cli-build.js` to funnel assets from the `slick-carousel` npm package into both the `vendor` and `public` trees, followed by `app.import` calls for vendor assets.
Review the new behavior documented for v0.2.0, especially regarding how assets are funneled and consumed when your addon is a transitive dependency. Reconfigure `nodeAssets` definitions as needed.
Ensure that any dynamic configuration functions correctly use `this` to refer to the app or addon instance, as intended. The fix ensured `this` correctly refers to the addon or app instance.
Adopt the recommended pattern of defining explicit `vendor` and `public` configurations with `srcDir`, `destDir`, and `include` options. Then, use `app.import` for assets placed in `vendor`.
Consider migrating to alternative, actively maintained solutions for managing third-party assets in Ember, such as directly importing ES modules from `node_modules` where possible, or using build configuration for bundlers integrated into Ember CLI.
Verify the `srcDir`, `destDir`, and `include` paths in your `nodeAssets` configuration for the package. Ensure the `app.import` path matches the funneled destination exactly.
Inspect your `nodeAssets` configuration for the problematic package. Ensure all path-related options (like `include`, `srcDir`, `destDir`) are correctly formatted as strings or arrays of strings.
Confirm that your `nodeAssets` object is a direct property of the `options` object passed to `EmberApp` for applications, or nested under `module.exports.options` for addons.
Ensure your dynamic configuration function returns a hash with `vendor` and/or `public` keys, each containing valid `broccoli-funnel` options for that target tree.