File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -84,7 +84,25 @@ module.exports = {
84
84
new MiniCssExtractPlugin ( { filename : __DEV__ ? '[name].css' : '[name].[contenthash].css' } ) ,
85
85
__PROD__ && new ImageminPlugin ( { test : / \. ( j p e ? g | p n g | g i f | s v g ) $ / i } ) ,
86
86
__DEV__ && new webpack . HotModuleReplacementPlugin ( ) ,
87
+ new webpack . HashedModuleIdsPlugin ( ) ,
87
88
// new BundleAnalyzerPlugin(),
88
89
] ) ,
90
+ optimization : {
91
+ runtimeChunk : 'single' ,
92
+ splitChunks : {
93
+ chunks : 'all' ,
94
+ maxInitialRequests : Infinity ,
95
+ minSize : 128 * 1024 ,
96
+ cacheGroups : {
97
+ vendor : {
98
+ test : / [ \\ / ] n o d e _ m o d u l e s [ \\ / ] / ,
99
+ name ( module ) {
100
+ const packageName = module . context . match ( / [ \\ / ] n o d e _ m o d u l e s [ \\ / ] ( .* ?) ( [ \\ / ] | $ ) / ) [ 1 ] ;
101
+ return `npm.${ packageName . replace ( '@' , '' ) } ` ;
102
+ } ,
103
+ } ,
104
+ } ,
105
+ } ,
106
+ } ,
89
107
mode : __DEV__ ? 'development' : 'production' ,
90
108
} ;
You can’t perform that action at this time.
0 commit comments