{"id":14547,"library":"ember-cli-node-assets","title":"Ember CLI Node Assets","description":"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.","status":"abandoned","version":"0.2.2","language":"javascript","source_language":"en","source_url":"https://github.com/dfreeman/ember-cli-node-assets","tags":["javascript","ember-addon"],"install":[{"cmd":"npm install ember-cli-node-assets","lang":"bash","label":"npm"},{"cmd":"yarn add ember-cli-node-assets","lang":"bash","label":"yarn"},{"cmd":"pnpm add ember-cli-node-assets","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"This package is an Ember CLI addon and extends the Ember CLI build system. It is a peer dependency by nature of its function.","package":"ember-cli","optional":false}],"imports":[{"note":"This addon does not export JavaScript symbols for direct import. Its functionality is configured via the `nodeAssets` key within the `EmberApp` options in `ember-cli-build.js` for applications, or within the `options` hash of an addon's `index.js`.","wrong":"import { nodeAssets } from 'ember-cli-node-assets';","symbol":"nodeAssets Configuration","correct":"let app = new EmberApp(defaults, {\n  nodeAssets: { /* ... config ... */ }\n});"},{"note":"After configuring `ember-cli-node-assets` to funnel files into the `vendor` tree, developers use the standard Ember CLI `app.import()` method to explicitly include those assets in their build. This is not an import *from* `ember-cli-node-assets` but a usage pattern that relies on it.","wrong":"import 'vendor/slick-carousel/slick.js';","symbol":"app.import()","correct":"app.import('vendor/slick-carousel/slick.js');"},{"note":"When used within an Ember addon, `ember-cli-node-assets` is configured by placing the `nodeAssets` object within the `options` property of the addon's `module.exports` object in its `index.js` file.","wrong":"module.exports.nodeAssets = { /* ... */ };","symbol":"Addon Configuration `options.nodeAssets`","correct":"module.exports = {\n  name: 'my-addon',\n  options: {\n    nodeAssets: { /* ... config ... */ }\n  }\n};"}],"quickstart":{"code":"/* ember-cli-build.js for an Ember application */\nconst EmberApp = require('ember-cli/lib/broccoli/ember-app');\n\nmodule.exports = function(defaults) {\n  let app = new EmberApp(defaults, {\n    nodeAssets: {\n      'slick-carousel': {\n        vendor: {\n          srcDir: 'slick',\n          destDir: 'slick-carousel',\n          include: ['slick.js', 'slick.css', 'slick-theme.css']\n        },\n        public: {\n          srcDir: 'slick',\n          destDir: 'assets',\n          include: ['ajax-loader.gif', 'fonts/*']\n        }\n      }\n    }\n  });\n\n  // Import assets that were funneled into the vendor tree\n  app.import('vendor/slick-carousel/slick.js');\n  app.import('vendor/slick-carousel/slick.css');\n  app.import('vendor/slick-carousel/slick-theme.css');\n\n  return app;\n};","lang":"javascript","description":"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."},"warnings":[{"fix":"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.","message":"Upgrading to v0.2.0 impacts how addons included as transitive dependencies behave. Addon authors should review their asset inclusion strategy.","severity":"breaking","affected_versions":">=0.2.0"},{"fix":"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.","message":"The `this` context for dynamic configuration functions was previously incorrect and was fixed in v0.2.0-beta.2. If you relied on an incorrect `this` value, your dynamic configurations may break or behave unexpectedly after upgrading.","severity":"gotcha","affected_versions":">=0.2.0-beta.2"},{"fix":"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`.","message":"Starting with v0.2.0-beta.1, documentation and recommended practice shifted towards explicit funneling of files into `vendor` and `public` trees, rather than relying on implicit imports. While older shorthand for importing specific files still works, it's now a funneling shortcut.","severity":"gotcha","affected_versions":">=0.2.0-beta.1"},{"fix":"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.","message":"The package `ember-cli-node-assets` appears to be abandoned, with no updates or commits since February 2020. It may not be compatible with newer versions of Ember CLI or Node.js, and potential security vulnerabilities will not be patched.","severity":"deprecated","affected_versions":">=0.2.2"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Verify the `srcDir`, `destDir`, and `include` paths in your `nodeAssets` configuration for the package. Ensure the `app.import` path matches the funneled destination exactly.","cause":"The `nodeAssets` configuration for the specified package did not correctly funnel the file to the expected `destDir` within the `vendor` tree, or `app.import` path is incorrect.","error":"File not found: vendor/my-package/some-file.js"},{"fix":"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.","cause":"An option passed to `broccoli-funnel` via `nodeAssets` configuration (e.g., `include`, `srcDir`, `destDir`) is not a string or array of strings as expected.","error":"Error: Path must be a string. Received type object."},{"fix":"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.","cause":"The `nodeAssets` configuration was not correctly placed within the `options` object passed to `EmberApp` in `ember-cli-build.js`, or within the `module.exports.options` object for an addon's `index.js`.","error":"TypeError: Cannot read properties of undefined (reading 'nodeAssets')"},{"fix":"Ensure your dynamic configuration function returns a hash with `vendor` and/or `public` keys, each containing valid `broccoli-funnel` options for that target tree.","cause":"A dynamic `nodeAssets` configuration function returned an object that does not conform to the expected structure (i.e., lacking `vendor` or `public` keys at the top level).","error":"Error: dynamic configuration function for 'some-node-module' returned an invalid object. Expected an object with 'vendor' and/or 'public' keys."}],"ecosystem":"npm"}