This lets you compile transpile ES 2015 Javascript code into ES 2009 Javascript code.
It was created in 2014 by Sebastian McKenzie.
Babel is a JavaScript transpiler that allows 'new' JavaScript to run in 'old' browsers
link -
It transpiles all the latest JavaScript syntax and features into regular ES 2009 JavaScript code
Extremely useful because not all browsers support all the latest JavaScript features
IE 11 does not support JavaScript ES 2015 code
Babel can convert TypeScript into regular JavaScript
Babel can convert JSX into regular JavaScript
Configuration options can be put inside the 'webpack.config.js' file (no .babelrc file)


A Plugin is a specific code transformation that can be included during compilation.
link -


A Preset is a group of plugins used to support particular language features.
link -


You can use a separate file or you can include these details into the 'webpack.config.js' file
Adding the presets and plugins to the webpack config file will only affect webpack
Anything else that uses Babel will be looking for the .babelrc file.

  module: { 
    rules: [
        test: /.js?$/,
        exclude: /node_modules/,
        use: {
          loader: 'babel-loader',
          options: {
             presets: [
             plugins: [


This lets you load other babel presets.

npm install --save-dev babel-loader 


This includes a custom regenerator runtime and core.js
This emulates a full ES 2015 environment
This needs to be dependency not a devDependency
This replaces '@babel/polyfill' which was deprecated in Babel version 7.4.0


This lets you access the babel API.

npm install --save-dev @babel/core 

© 2022 Better Solutions Limited. All Rights Reserved. © 2022 Better Solutions Limited TopPrevNext