Commit 709536d5f1996a7a497ebeb937296cbc806c3bdd
1 parent
cc2faed2
关闭生产环境 打印和代码map块
Showing
1 changed file
with
5 additions
and
2 deletions
webintroduce/build/webpack.prod.conf.js
@@ -35,7 +35,10 @@ const webpackConfig = merge(baseWebpackConfig, { | @@ -35,7 +35,10 @@ const webpackConfig = merge(baseWebpackConfig, { | ||
35 | new UglifyJsPlugin({ | 35 | new UglifyJsPlugin({ |
36 | uglifyOptions: { | 36 | uglifyOptions: { |
37 | compress: { | 37 | compress: { |
38 | - warnings: false | 38 | + warnings: false, |
39 | + drop_debugger: true,//console | ||
40 | + drop_console: true, | ||
41 | + pure_funcs: ['console.log']//移除console | ||
39 | } | 42 | } |
40 | }, | 43 | }, |
41 | sourceMap: config.build.productionSourceMap, | 44 | sourceMap: config.build.productionSourceMap, |
@@ -46,7 +49,7 @@ const webpackConfig = merge(baseWebpackConfig, { | @@ -46,7 +49,7 @@ const webpackConfig = merge(baseWebpackConfig, { | ||
46 | filename: utils.assetsPath('css/[name].[contenthash].css'), | 49 | filename: utils.assetsPath('css/[name].[contenthash].css'), |
47 | // Setting the following option to `false` will not extract CSS from codesplit chunks. | 50 | // Setting the following option to `false` will not extract CSS from codesplit chunks. |
48 | // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. | 51 | // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. |
49 | - // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, | 52 | + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, |
50 | // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 | 53 | // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 |
51 | allChunks: true, | 54 | allChunks: true, |
52 | }), | 55 | }), |