I am looking to compile my code into ES6 instead of ES5. Here is the configuration in my babelrc file:
{
"presets": [
[
"env",
{
"modules": false,
"useBuiltIns": true,
"targets": {
"browsers": ["Chrome >= 60"]
}
}
],
["react"],
["stage-2"]
]}
By using babel-cli, I can successfully compile my code into ES6 format. For instance:
https://i.sstatic.net/X3bEK.png
However, when I introduce webpack and babel-loader into the same babel configuration, my ES6 code ends up being compiled into ES5.
So, my question is: How can I ensure that Webpack compiles ES6+ code into ES6+ code?
Does webpack automatically convert ES6+ code into ES5 during compilation?