diff --git a/public/react/config/webpack.config.dev.js b/public/react/config/webpack.config.dev.js index 48e4f7f52..a203e798d 100644 --- a/public/react/config/webpack.config.dev.js +++ b/public/react/config/webpack.config.dev.js @@ -274,19 +274,19 @@ module.exports = { /* 是否删除代码中所有的console语句,默认为不删除,开启后,会删除所有的console语句 */ - drop_console: true, + drop_console: false, /* 是否内嵌虽然已经定义了,但是只用到一次的变量,比如将 var x = 1; y = x, 转换成 y = 5, 默认为不 转换,为了达到更好的压缩效果,可以设置为false */ - collapse_vars: true, + collapse_vars: false, /* 是否提取出现了多次但是没有定义成变量去引用的静态值,比如将 x = 'xxx'; y = 'xxx' 转换成 var a = 'xxxx'; x = a; y = a; 默认为不转换,为了达到更好的压缩效果,可以设置为false */ - reduce_vars: true + reduce_vars: false } } }), diff --git a/public/react/config/webpack.config.prod.js b/public/react/config/webpack.config.prod.js index 9e9da3db1..ff6472547 100644 --- a/public/react/config/webpack.config.prod.js +++ b/public/react/config/webpack.config.prod.js @@ -58,8 +58,8 @@ module.exports = { bail: true, // We generate sourcemaps in production. This is slow but gives good results. // You can exclude the *.map files from the build during deployment. - devtool: shouldUseSourceMap ? 'nosources-source-map' : false, //正式版 - // devtool: shouldUseSourceMap ? 'source-map' : false,//测试版 + // devtool: shouldUseSourceMap ? 'nosources-source-map' : false, //正式版 + devtool: shouldUseSourceMap ? 'source-map' : false,//测试版 // In production, we only want to load the polyfills and the app code. entry: [require.resolve('./polyfills'), paths.appIndexJs], output: { @@ -292,7 +292,7 @@ module.exports = { // }, // sourceMap: shouldUseSourceMap, // }), - + //正式版上线后打开去掉debuger和console new ParallelUglifyPlugin({ cacheDir: '.cache/', uglifyJS:{ @@ -301,8 +301,8 @@ module.exports = { }, warnings: false, compress: { - drop_debugger: true, - drop_console: true + drop_debugger: false, + drop_console: false } } }),