Babel is JavaScript build tooling that transpiles newer syntax, such as ES6 classes and fat-arrow functions, into older JavaScript for environments such as IE11. section 12.5
A minimal Babel setup uses:
- @babel/core for Babel’s main feature set, @babel/cli for command-line execution, and @babel/preset-env for standard configuration. section 12.5
- A Babel configuration containing { "presets": ["@babel/preset-env"] }. section 12.5
- Development dependencies installed locally, keeping build tooling out of the released component. section 12.5
Separate IE output
Run Babel on a bundled component with ./node_modules/.bin/babel slider.js --out-file slider.build.js. Keep this output separate from the modern-browser build, then combine component-specific IE commands under npm run build-ie. section 12.5
npm install --save-dev @babel/core npm install --save-dev @babel/cli npm install --save-dev @babel/preset-env
Inspect the three npm installation commands for Babel’s core, CLI, and preset-env packages. section 12.5
