Babel
Babel complies the new js depencies down to basic js allowing it to be used across browsers
No real competition, this is it baby
you install individual plugins to get any features and set .babelrc
or babel.config.js
or something
Webpack or browserify will do this auto
Watch out, all the babel 6 guides have all the plugins/extensions use something like babel-preset-env
while babel 7 changed everything to @babel/preset-env
Super Basic
Babel Standalone
A nice collection of babel and plugins
Load External Scripts
Command LIne
You can install a babel cli and run the command to compile it and see it yourself
Basic Configuration
You want to programmatically create the configuration?
You want to compile
node_modules
?
babel.config.js
is for you!
You have a static configuration that only applies to your simple single package?
.babelrc
is for you!
You just add npm install the plugin and add it to this list
Async/Await Runtime
Add this as a plugin as above
Presets
Groups of plugins
babel-preset-env
npm install --save-dev @babel/preset-env
.babelrc
Allows you to specify the specific browsers to support which can greatly simplify file size
source maps are to allow debugging in the console to the correct lines
Good default
@babel/core @babel/cli
do nothing alone
babel-loader
is for web pack usage and configuration
babel-preset-react
is for react stuff
.babelrc
Last updated