Skip to content

Commit caf7536

Browse files
committed
update
1 parent f1f9e6d commit caf7536

File tree

5 files changed

+29
-11
lines changed

5 files changed

+29
-11
lines changed

build/demand.config.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const { resolve, getComponentEntries } = require("./utils")
2+
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
23
const webpack = require('webpack');
3-
44
module.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: {

build/utils.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
const fs = require('fs')
22
const path = require('path')
3-
const fileLoader = require('ks-file-loader').default
43
const resolve = (...dir) => {
54
return path.join(process.cwd(), ...dir)
65
}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@
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"

vue.config.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff 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'))

yarn.lock

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff 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+
81998218
webpack-chain@^6.4.0:
82008219
version "6.5.1"
82018220
resolved "https://registry.npmjs.org/webpack-chain/-/webpack-chain-6.5.1.tgz#4f27284cbbb637e3c8fbdef43eef588d4d861206"

0 commit comments

Comments
 (0)