ember-cli-babel is the official Ember CLI addon responsible for integrating Babel into Ember applications and addons. It transpiles modern JavaScript (ESNext) down to a syntax supported by target browsers, leveraging `@babel/preset-env` and respecting the `config/targets.js` file. The current stable version is 8.3.1, with releases occurring as needed to align with Babel updates, Ember CLI changes, and bug fixes. Key differentiators include its deep integration with the Ember CLI build pipeline, automatic polyfill management (though `includePolyfill` was removed in v8), and support for advanced features like static class blocks and TypeScript transpilation. It provides a robust, zero-config-by-default setup while offering extensive customization options through the `ember-cli-build.js` file for both Babel presets/plugins and `ember-cli-babel`'s internal behavior, making it indispensable for modern Ember development.
npm install ember-cli-babelVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to configure `ember-cli-babel` within `ember-cli-build.js`, including setting Babel options (like `loose` mode and custom plugins) and `ember-cli-babel` specific options (like enabling TypeScript transpilation or disabling debug tooling).
Upgrade your Node.js environment to version 16, 18, or 20 or newer to use `ember-cli-babel` v8+.
Remove the `includePolyfill` option. Manually add polyfills using a tool like `ember-auto-import` combined with `core-js` or `@babel/polyfill` for explicit polyfill management.
Review `broccoli-babel-transpiler` v8 release notes if you encounter unexpected build issues after upgrading. Most applications should not require direct changes.
Migrate any existing `.babelrc` configuration into the `babel` property of your `EmberApp` options in `ember-cli-build.js`.
If manually specifying Babel plugins, ensure you are using the correct `@babel/plugin-transform-*` packages where applicable, especially for features like class properties, decorators, and private methods.
Upgrade your Node.js environment to a supported version (e.g., `nvm install 18` and `nvm use 18`).
Remove your `.babelrc` file and transfer all Babel configurations to the `babel` object within your `new EmberApp()` constructor in `ember-cli-build.js`.
Either remove `transform-regenerator` from the `exclude` list in your Babel configuration, or ensure that a polyfill like `core-js/stable/regenerator-runtime` is explicitly imported in your application.