Webpack 4.x 默认支持 ES6 语法
Q: 为什么 webpack4 默认支持 ES6 语法的压缩?
A: terser 里面实现了 ES6 语法的 AST解析.
- webpack 4 里使用了
terser-webpack-plugin
插件, 替代原来 webpack 使用的uglifyjs-webpack-plugin
插件,作为它的内置插件;
Switch from uglifyjs-webpack-plugin to terser-webpack-plugin, Nov 19, 2018
https://github.com/webpack/webpack/tree/311a7285d36b38bada46102967c431e93ff48a89
webpack dependency graph
webpack 模块依赖图
terser-webpack-plugin
https://github.com/webpack-contrib/terser-webpack-plugin
https://github.com/webpack/webpack/tree/311a7285d36b38bada46102967c431e93ff48a89
refs
https://github.com/cpselvis/geektime-webpack-course/issues/4
https://npm.broofa.com/?q=webpack
©xgqfrms 2012-2020
www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!