File tree Expand file tree Collapse file tree 5 files changed +29
-11
lines changed
Expand file tree Collapse file tree 5 files changed +29
-11
lines changed Original file line number Diff line number Diff line change 11const { resolve, getComponentEntries } = require ( "./utils" )
2+ const BundleAnalyzerPlugin = require ( 'webpack-bundle-analyzer' ) . BundleAnalyzerPlugin ;
23const webpack = require ( 'webpack' ) ;
3-
44module . exports = ( baseConfig = { } ) => {
55 const { configureWebpack, chainWebpack, css } = baseConfig
66 const packages = 'packages'
@@ -26,17 +26,19 @@ module.exports = (baseConfig = {}) => {
2626 splitChunks : {
2727 cacheGroups : {
2828 common : {
29- // test : /\.(j|t)s(x|)$/,
3029 name : "common" ,
30+ minChunks : 5 ,
3131 chunks : "initial" ,
32- minChunks : 3 ,
33- filename : '[name].bundle.js'
32+ filename : '[name].bundle.js' ,
33+ priority : 5
3434 }
3535 }
3636 }
37- }
37+ } ,
38+ plugins :[
39+ new BundleAnalyzerPlugin ( )
40+ ]
3841 } ,
39- // 样式输出
4042 css : Object . assign ( { } , css , {
4143 sourceMap : true ,
4244 extract : {
Original file line number Diff line number Diff line change 11const fs = require ( 'fs' )
22const path = require ( 'path' )
3- const fileLoader = require ( 'ks-file-loader' ) . default
43const resolve = ( ...dir ) => {
54 return path . join ( process . cwd ( ) , ...dir )
65}
Original file line number Diff line number Diff line change 3636 "vue" : " ^3.0.0-rc.7" ,
3737 "vue-router" : " ^4.0.0-0" ,
3838 "vuex" : " ^4.0.0-0" ,
39- "webpack" : " ^4.44.1"
39+ "webpack" : " ^4.44.1" ,
40+ "webpack-bundle-analyzer" : " ^3.9.0"
4041 },
4142 "bugs" : {
4243 "url" : " https://github.com/kscript/zero/issues"
Original file line number Diff line number Diff line change @@ -41,9 +41,6 @@ module.exports = loadConfig({
4141 }
4242 }
4343 } ,
44- externals : {
45- vue : "Vue"
46- } ,
4744 chainWebpack : config => {
4845 config . resolve . alias
4946 . set ( '@@' , resolve ( 'examples' ) )
Original file line number Diff line number Diff line change @@ -8196,6 +8196,25 @@ webpack-bundle-analyzer@^3.8.0:
81968196 opener "^1.5.1"
81978197 ws "^6.0.0"
81988198
8199+ webpack-bundle-analyzer@^3.9.0 :
8200+ version "3.9.0"
8201+ resolved "https://registry.npmjs.org/webpack-bundle-analyzer/-/webpack-bundle-analyzer-3.9.0.tgz#f6f94db108fb574e415ad313de41a2707d33ef3c"
8202+ integrity sha512-Ob8amZfCm3rMB1ScjQVlbYYUEJyEjdEtQ92jqiFUYt5VkEeO2v5UMbv49P/gnmCZm3A6yaFQzCBvpZqN4MUsdA==
8203+ dependencies :
8204+ acorn "^7.1.1"
8205+ acorn-walk "^7.1.1"
8206+ bfj "^6.1.1"
8207+ chalk "^2.4.1"
8208+ commander "^2.18.0"
8209+ ejs "^2.6.1"
8210+ express "^4.16.3"
8211+ filesize "^3.6.1"
8212+ gzip-size "^5.0.0"
8213+ lodash "^4.17.19"
8214+ mkdirp "^0.5.1"
8215+ opener "^1.5.1"
8216+ ws "^6.0.0"
8217+
81998218webpack-chain@^6.4.0 :
82008219 version "6.5.1"
82018220 resolved "https://registry.npmjs.org/webpack-chain/-/webpack-chain-6.5.1.tgz#4f27284cbbb637e3c8fbdef43eef588d4d861206"
You can’t perform that action at this time.
0 commit comments