Today Vue Project NPM Run build after Webpack, error UGLIFYJS, their own research, translated, meaning is not recognized in the project to write advanced grammar, here to the project ES6 syntax es5 let the browser recognize,
That is Webpack's Babel need to be configured under
Babel is actually a platform for compiling JavaScript, and its strength is that it can be compiled to help you achieve the following:
- Use the next generation of JavaScript code (ES6,ES7 ... ), even though these standards are not currently fully supported by the current browser;
- Using JavaScript-based languages such as React's jsx;
1. Install the package first
NPM Install babel-preset-es2015
2. Configure Webpack.base.conf.js
{
Test:/\.js$/,
Loader: ' Babel-loader ',
options:{
presets:["es2015"]
},
Exclude:[/node_modules/]
},
3.OK, re-build the NPM Run build project package, okay.
Webpack packaging does not recognize ES6 syntax of pits