|
@@ -1,5 +1,6 @@
|
|
|
'use strict'
|
|
|
const path = require('path')
|
|
|
+const fs = require('fs')
|
|
|
|
|
|
function resolve(dir) {
|
|
|
return path.join(__dirname, dir)
|
|
@@ -107,7 +108,6 @@ module.exports = {
|
|
|
cacheGroups: {
|
|
|
libs: {
|
|
|
name: 'libs',
|
|
|
- // test: /[\\/]node_modules[\\/]/,
|
|
|
priority: 50,
|
|
|
chunks: 'initial',
|
|
|
},
|
|
@@ -115,32 +115,26 @@ module.exports = {
|
|
|
name: 'elementUI', // split elementUI into a single package
|
|
|
priority: 40,
|
|
|
test: /[\\/]node_modules[\\/]_?element-ui(.*)/,
|
|
|
- chunks: 'async',
|
|
|
},
|
|
|
avue: {
|
|
|
name: 'avue', // split avue into a single package
|
|
|
priority: 41,
|
|
|
test: /[\\/]node_modules[\\/]@smallwei(.*)/,
|
|
|
- chunks: 'async',
|
|
|
reuseExistingChunk: true
|
|
|
},
|
|
|
utils: {
|
|
|
name: 'utils',
|
|
|
test: /([\\/]src[\\/]utils)|lodash|axios|crypto-js/,
|
|
|
priority: 30,
|
|
|
- chunks: 'async',
|
|
|
},
|
|
|
styles: {
|
|
|
name: 'styles', // pack all remaining style files
|
|
|
test: /\.(css|scss)$/,
|
|
|
priority: 45,
|
|
|
- chunks: 'all',
|
|
|
reuseExistingChunk: true
|
|
|
- }
|
|
|
+ },
|
|
|
}
|
|
|
})
|
|
|
- // https:// webpack.js.org/configuration/optimization/#optimizationruntimechunk
|
|
|
- config.optimization.runtimeChunk(false)
|
|
|
}
|
|
|
)
|
|
|
}
|