I have already used this in my webpack.config.js
use: [{
loader: 'babel-loader',
options: {
presets: ['es2015', 'es2016', 'react']
}
}]
But still I am getting error at the token let which I have used.
I get that uglify doesn't understands ECMAScript-6
Now when i build my webpack with -p, i get the mentioned error, because uglify comes up there. Now, how can i solve this problem as I have already included babel-loader preset es2015 to convert es6 to es5.
As you've said, your current version of the Uglify plugin doesn't support ES6, so you'll need to upgrade. You have a few options: