Ember CLI Babel Polyfills

raw JSON →
2.0.1 verified Sat Apr 25 auth: no javascript

An Ember addon (v2.0.1, latest) that automatically produces split builds of Babel polyfills (using core-js directly since v2.0.0) for evergreen and legacy browsers. It injects three script tags into index.html: polyfill-shared.js, polyfill-evergreen.js, and polyfill-legacy.js (the latter with nomodule attribute to skip modern browsers). Key differentiator: dynamic polyfill generation via Babel's presetEnv, so only necessary polyfills are shipped to each browser category. Suitable for Ember apps using Babel 7+; drops support for Babel 6 in v2.

error Error: Could not find module `ember-cli-babel-polyfills`
cause Addon not installed via ember install or missing from package.json.
fix
Run 'ember install ember-cli-babel-polyfills'.
error TypeError: Cannot read property 'polyfill' of undefined
cause Using v2+ with Babel 6; the addon now requires core-js from Babel 7.
fix
Upgrade to Babel 7 and ember-cli-babel >=7.0.0.
error Polyfill scripts not appearing in index.html
cause Configuration includeScriptTags set to false or overridden by another addon.
fix
Set includeScriptTags: true in ember-cli-build.js or ensure no addon removes them.
breaking v2.0.0 drops support for Babel 6 and switches from @babel/polyfill to core-js directly.
fix Upgrade to Babel 7 and ensure your app uses ember-cli-babel ^7.0.0.
gotcha The addon expects ember-cli-build.js configuration key to be exactly 'ember-cli-babel-polyfills' (string).
fix Use string key 'ember-cli-babel-polyfills' in EmberApp options.
gotcha includeScriptTags: false will not inject any script tags; you must manually add them.
fix Set includeScriptTags: true or manually add polyfill scripts to your index.html.
npm install ember-cli-babel-polyfills
yarn add ember-cli-babel-polyfills
pnpm add ember-cli-babel-polyfills

Installs the addon and shows basic configuration for customizing browser targets.

// Install the addon
ember install ember-cli-babel-polyfills

// No further configuration needed; polyfills are auto-added.
// To customize targets, edit ember-cli-build.js:
let app = new EmberApp(defaults, {
  'ember-cli-babel-polyfills': {
    evergreenTargets: [
      'last 2 Chrome versions',
      'last 2 Firefox versions',
      'last 2 Safari versions',
    ],
    legacyTargets: [
      'last 1 version',
      '> 1%',
      'not dead',
    ],
    includeScriptTags: true,
  },
});