Commit bc04df4b authored by 郝聪敏's avatar 郝聪敏

Merge branch 'feature/fix_build' into 'master'

fix: 优化打包

See merge request !102
parents 43a42c26 f09990fa
......@@ -62,6 +62,14 @@ module.exports = {
config.optimization.splitChunks({
chunks: "all",
cacheGroups: {
pdfjs: {
name: "chunk-pdfjs", // split cherryUI into a single package
priority: 21, // the weight needs to be larger than libs and app or it will be packaged into libs or app
test: /[\\/]node_modules[\\/]pdfjs-dist[\\/]es5[\\/]/, // in order to adapt to cnpm
chunks: "all",
reuseExistingChunk: true,
enforce: true
},
cherryUI: {
name: "chunk-cherryUI", // split cherryUI into a single package
priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app
......@@ -78,6 +86,14 @@ module.exports = {
reuseExistingChunk: true,
enforce: true
},
lodash: {
name: "chunk-lodash", // split cherryUI into a single package
priority: 18, // the weight needs to be larger than libs and app or it will be packaged into libs or app
test: /[\\/]node_modules[\\/]lodash[\\/]/, // in order to adapt to cnpm
chunks: "initial",
reuseExistingChunk: true,
enforce: true
},
libs: {
name: "chunk-libs",
test: /[\\/]node_modules[\\/]/,
......@@ -86,20 +102,29 @@ module.exports = {
reuseExistingChunk: true,
enforce: true
},
api: {
name: "chunk-api",
svg: {
name: "chunk-svg",
priority: 9,
chunks: "initial",
test: resolve("src/assets/icons/svg"),
reuseExistingChunk: true,
enforce: true
},
images: {
name: "chunk-image",
priority: 8,
chunks: "all",
minChunks: 3,
test: resolve("src/api"),
test: resolve("src/assets/images"),
reuseExistingChunk: true,
enforce: true
},
svg: {
name: "chunk-svg",
priority: 8,
chunks: "initial",
test: resolve("src/assets/icons/svg"),
api: {
name: "chunk-api",
priority: 7,
chunks: "all",
minChunks: 3,
test: resolve("src/api"),
reuseExistingChunk: true,
enforce: true
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment