File tree Expand file tree Collapse file tree 5 files changed +50
-6
lines changed
Expand file tree Collapse file tree 5 files changed +50
-6
lines changed Original file line number Diff line number Diff line change 2020 "nprogress" : " ^0.2.0" ,
2121 "qs" : " ^6.7.0" ,
2222 "register-service-worker" : " ^1.6.2" ,
23+ "uglifyjs-webpack-plugin" : " ^2.1.2" ,
2324 "vue" : " ^2.6.6" ,
2425 "vue-router" : " ^3.0.1" ,
2526 "vuex" : " ^3.0.1" ,
Original file line number Diff line number Diff line change 99 :prop =" item.prop"
1010 :label =" item.label"
1111 :width =" item.width"
12+ :min-width =" item.minWidth"
1213 :key =" item.prop"
1314 >
1415 <template #default =" {row ,column ,$index } " >
Original file line number Diff line number Diff line change 99 </el-button >
1010 <edit-table
1111 :columns =" columns"
12- :tableData =" tableData"
12+ :tableData.sync =" tableData"
1313 >
1414 </edit-table >
1515 <el-dialog
5454 }
5555 },
5656 { prop: ' email' , label: ' 邮箱' , width: ' 220' },
57- { prop: ' address' , label: ' 地址' },
57+ { prop: ' address' , label: ' 地址' , minWidth : ' 320 ' },
5858 ],
5959 tableData: data .dataSource ,
6060 dialogVisible: false
Original file line number Diff line number Diff line change 1+ const UglifyJsPlugin = require ( 'uglifyjs-webpack-plugin' ) ;
12const path = require ( 'path' ) ;
23const resolve = dir => path . resolve ( __dirname , `src/${ dir } /` ) ;
34const argv = process . argv ;
45const mode = argv [ argv . indexOf ( '--project-mode' ) + 1 ] ;
6+ const isPro = process . env . NODE_ENV === 'production' ;
57module . exports = {
68 // 前端配置,当启用mock的时候关闭,跨域时开启
79 // devServer: {
@@ -19,8 +21,8 @@ module.exports = {
1921 // 关闭eslint
2022 lintOnSave : false ,
2123 outputDir : `dist` ,
22- productionSourceMap : process . env . NODE_ENV === 'development' , // 打包时关闭sourceMap
23- publicPath : process . env . NODE_ENV === 'development' ? '.' : ' /vue-admin/',
24+ productionSourceMap : ! isPro , // 打包时关闭sourceMap
25+ publicPath : isPro ? '/vue-admin/' : '. ',
2426 chainWebpack : config => {
2527 // 这里是对环境的配置,不同环境对应不同的BASE_API,以便axios的请求地址不同
2628 // 这里用到了webpack.DefinePlugin
@@ -66,5 +68,23 @@ module.exports = {
6668 `
6769 }
6870 }
71+ } ,
72+ configureWebpack : {
73+ optimization : { // 移除打包后的console.log
74+ minimizer : [
75+ new UglifyJsPlugin ( {
76+ uglifyOptions : {
77+ compress : {
78+ warnings : false ,
79+ drop_console : isPro , //console
80+ drop_debugger : false // pure_funcs: ['console.log']移除
81+ }
82+ }
83+ } )
84+ ]
85+ } ,
86+ performance : { // 关闭性能提示信息
87+ hints : false ,
88+ }
6989 }
7090} ;
Original file line number Diff line number Diff line change @@ -1793,7 +1793,7 @@ cacache@^10.0.4:
17931793 unique-filename "^1.1.0"
17941794 y18n "^4.0.0"
17951795
1796- cacache@^11.0.2 :
1796+ cacache@^11.0.2, cacache@^11.2.0 :
17971797 version "11.3.2"
17981798 resolved "http://registry.npm.taobao.org/cacache/download/cacache-11.3.2.tgz#2d81e308e3d258ca38125b676b98b2ac9ce69bfa"
17991799 integrity sha1-LYHjCOPSWMo4Eltna5iyrJzmm/o=
@@ -2167,7 +2167,7 @@ combined-stream@^1.0.6, combined-stream@~1.0.6:
21672167 dependencies :
21682168 delayed-stream "~1.0.0"
21692169
2170- commander@* :
2170+ commander@*, commander@~2.20.0 :
21712171 version "2.20.0"
21722172 resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.0.tgz#d58bb2b5c1ee8f87b0d340027e9e94e222c5a422"
21732173 integrity sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==
@@ -8152,6 +8152,28 @@ uglify-js@3.4.x:
81528152 commander "~2.17.1"
81538153 source-map "~0.6.1"
81548154
8155+ uglify-js@^3.0.0 :
8156+ version "3.5.6"
8157+ resolved "http://registry.npm.taobao.org/uglify-js/download/uglify-js-3.5.6.tgz#8a5f8a06ee7415ac1fa302f4623bc7344b553da4"
8158+ integrity sha1-il+KBu50FawfowL0YjvHNEtVPaQ=
8159+ dependencies :
8160+ commander "~2.20.0"
8161+ source-map "~0.6.1"
8162+
8163+ uglifyjs-webpack-plugin@^2.1.2 :
8164+ version "2.1.2"
8165+ resolved "http://registry.npm.taobao.org/uglifyjs-webpack-plugin/download/uglifyjs-webpack-plugin-2.1.2.tgz#70e5c38fb2d35ee887949c2a0adb2656c23296d5"
8166+ integrity sha1-cOXDj7LTXuiHlJwqCtsmVsIyltU=
8167+ dependencies :
8168+ cacache "^11.2.0"
8169+ find-cache-dir "^2.0.0"
8170+ schema-utils "^1.0.0"
8171+ serialize-javascript "^1.4.0"
8172+ source-map "^0.6.1"
8173+ uglify-js "^3.0.0"
8174+ webpack-sources "^1.1.0"
8175+ worker-farm "^1.5.2"
8176+
81558177unicode-canonical-property-names-ecmascript@^1.0.4 :
81568178 version "1.0.4"
81578179 resolved "http://registry.npm.taobao.org/unicode-canonical-property-names-ecmascript/download/unicode-canonical-property-names-ecmascript-1.0.4.tgz#2619800c4c825800efdd8343af7dd9933cbe2818"
You can’t perform that action at this time.
0 commit comments