1. Installation
npm install --save-dev babel-loader babel-core
2. Usage
via Config
var Person = require("babel!./Person.js").default;
new Person();
via Loader
module: {
rules: [
{ test: /\.js$/, exclude: /node_modules/, loader: "babel-loader" }
]
}
3. Create .babelrc configuration file
npm install babel-preset-env --save-dev
define .babelrc file
{
"presets": ["env"]
}