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 = {
8484 new MiniCssExtractPlugin ( { filename : __DEV__ ? '[name].css' : '[name].[contenthash].css' } ) ,
8585 __PROD__ && new ImageminPlugin ( { test : / \. ( j p e ? g | p n g | g i f | s v g ) $ / i } ) ,
8686 __DEV__ && new webpack . HotModuleReplacementPlugin ( ) ,
87+ new webpack . HashedModuleIdsPlugin ( ) ,
8788 // new BundleAnalyzerPlugin(),
8889 ] ) ,
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+ } ,
89107 mode : __DEV__ ? 'development' : 'production' ,
90108} ;
You can’t perform that action at this time.
0 commit comments