babel-preset-es2015-ie
raw JSON → 6.7.0 verified Sat Apr 25 auth: no javascript deprecated
A Babel preset that includes all ES2015 plugins with additional transforms to ensure compatibility with Internet Explorer 9 and 10. Version 6.7.0 is the latest stable release, designed for Babel 6. It wraps the official babel-preset-es2015 and adds IE-specific polyfills or transforms for features like default parameters, destructuring, and spread operators that are not fully supported in older IE versions. Unlike the base preset, it targets IE>=9 specifically, making it suitable for legacy enterprise applications. The package is no longer actively maintained as Babel 6 is deprecated in favor of Babel 7 and @babel/preset-env.
Common errors
error Error: Couldn't find preset "es2015-ie" relative to directory ↓
cause The preset is not installed or not in node_modules.
fix
Run npm install --save-dev babel-preset-es2015-ie
error Error: Requires Babel "^6.0.0-0" but was loaded with "7.x". ↓
cause Using the preset with Babel 7 instead of Babel 6.
fix
Downgrade to Babel 6 or migrate to @babel/preset-env.
error SyntaxError: Unexpected token import (or arrow function etc.) ↓
cause The preset is correctly configured but some modern syntax (e.g., dynamic imports) is not covered.
fix
Add additional presets or plugins (e.g., babel-plugin-syntax-dynamic-import).
Warnings
deprecated babel-preset-es2015-ie is deprecated; Babel 6 is end-of-life. Use @babel/preset-env with IE targets instead. ↓
fix Migrate to Babel 7 and use @babel/preset-env with targets: { ie: '9' }.
gotcha The preset does not include a polyfill for Promise, Map, Set, etc. Those must be added separately (e.g., babel-polyfill). ↓
fix Add import 'babel-polyfill' or configure core-js polyfills in Babel 7.
breaking This preset is designed for Babel 6 only. It will not work with Babel 7 (which uses @babel/ scoped packages). ↓
fix Upgrade to @babel/preset-env and use Babel 7.
Install
npm install babel-preset-es2015-ie yarn add babel-preset-es2015-ie pnpm add babel-preset-es2015-ie Imports
- Default (as preset) wrong
{ "presets": ["babel-preset-es2015-ie"] }correct{ "presets": ["es2015-ie"] } - Default (Node API) wrong
var preset = require('babel-preset-es2015-ie'); require('babel-core').transform('code', { presets: [preset] })correctrequire('babel-core').transform('code', { presets: ['es2015-ie'] }) - Via CLI wrong
babel script.js --presets babel-preset-es2015-iecorrectbabel script.js --presets es2015-ie
Quickstart
// Install the preset
// npm install --save-dev babel-preset-es2015-ie
// .babelrc
{
"presets": ["es2015-ie"]
}
// Example ES2015 code (will be transpiled for IE9+)
const sum = (a, b) => a + b;
let numbers = [1, 2, 3];
let doubled = numbers.map(n => n * 2);
console.log(doubled);