Ember CLI Import Polyfill
raw JSON →This package, `ember-cli-import-polyfill`, is an Ember CLI addon designed to backport a newer addon import API (specifically referencing Ember CLI pull request #5877) to earlier versions of Ember CLI. Ember CLI is a foundational command-line utility for managing Ember.js applications, providing a robust build pipeline, project structure conventions, and an extensible addon system. Released at version 0.2.0 and last published approximately eight years ago, this addon addressed compatibility issues during a transition period in Ember CLI's internal architecture. Its purpose was to enable addon authors to leverage newer JavaScript module APIs while maintaining backward compatibility with older host Ember CLI applications that did not natively support these module APIs. Due to its age and the natural evolution of Ember CLI, the functionality it polyfilled is now standard in modern Ember CLI versions, rendering this specific polyfill obsolete.
Common errors
error Error: Cannot find module 'ember-cli-import-polyfill' ↓
npm install ember-cli-import-polyfill or yarn add ember-cli-import-polyfill. If still failing, check for symlink usage and reinstall without symlinks. Ensure ember-cli is also correctly installed. error Build failed. The Broccoli Plugin '...' failed with: ... (related to module resolution or addon processing) ↓
ember-cli-import-polyfill from your project. If you *must* use an older Ember CLI, ensure its version aligns with the polyfill's expected environment. Warnings
deprecated This package is very old (last updated 8 years ago, v0.2.0) and targets a specific, outdated pull request (#5877) in Ember CLI. Its functionality is almost certainly integrated into current Ember CLI versions, making it unnecessary and potentially incompatible with modern Ember.js applications. ↓
gotcha The README explicitly states, 'This addon doesn't work when symlinked, because it needs implicit access to your ember-cli module.' This can cause issues in development environments where `npm link` or `yarn link` are used for local addon development. ↓
breaking Using this polyfill in newer Ember CLI versions (e.g., 3.x+) could lead to unexpected build failures or runtime errors due to conflicts with native Ember CLI features or module resolution logic. It targets an architectural gap that no longer exists. ↓
Install
npm install ember-cli-import-polyfill yarn add ember-cli-import-polyfill pnpm add ember-cli-import-polyfill Quickstart
npx ember install ember-cli-import-polyfill
// Addons are typically installed and then automatically integrated by Ember CLI.
// No direct JavaScript import statements are typically made by end-user application code for this type of addon.
// The addon modifies the Ember CLI build pipeline or provides blueprints/components.
// For more complex polyfills or build modifications, configuration might be added to ember-cli-build.js, e.g.:
// const EmberApp = require('ember-cli/lib/broccoli/ember-app');
// module.exports = function(defaults) {
// let app = new EmberApp(defaults, {
// // Example of hypothetical configuration for a polyfill addon
// 'ember-cli-import-polyfill': {
// enabled: true,
// // specific options related to its backporting logic
// }
// });
// return app.toTree();
// };