我正在使用webpack打包我的项目。我也希望破坏房产。
我的依赖项:
"uglify-js": "^3.3.12",
"uglifyjs-webpack-plugin": "^1.2.2",
"webpack": "^4.0.1",
"webpack-cli": "^2.0.9"
我的webpack.config.js
const webpack = require('webpack');
const path = require('path');
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
module.exports = {
entry: './src/index.js',
output: {
path: path.resolve(__dirname, './dist'),
filename: 'bundle.js'
},
mode: 'production',
optimization: {
minimizer: [
new UglifyJSPlugin({
uglifyOptions: {
mangle: {
properties: {
keep_quoted: true,
builtins: false // this option not working
},
},
},
}),
],
}
};
我哪里出错?
示例:console.log(window.navigator)
变为console.m(window.p)
答案 0 :(得分:0)
试试这个
new UglifyJSPlugin({
uglifyOptions: {
mangle: false
}
})