File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ const path = require('path');
33const merge = require ( 'lodash.merge' ) ;
44const nodeExternals = require ( 'webpack-node-externals' ) ;
55
6+ const DEFAULT_CHUNK_FILENAME = 'chunks/[name].[chunkhash].js' ;
7+
68/**
79 * @typedef {import('webpack').Configuration } Configuration
810 * @typedef {import('webpack').RuleSetRule } RuleSetRule
@@ -51,11 +53,17 @@ class ScratchWebpackConfigBuilder {
5153 [ libraryName ] : path . resolve ( this . _srcPath , 'index' )
5254 } : path . resolve ( this . _srcPath , 'index' ) ,
5355 optimization : {
54- minimize : isProduction
56+ minimize : isProduction ,
57+ splitChunks : {
58+ chunks : 'all' ,
59+ filename : DEFAULT_CHUNK_FILENAME
60+ } ,
61+ mergeDuplicateChunks : true
5562 } ,
5663 output : {
5764 clean : true ,
5865 filename : '[name].js' ,
66+ chunkFilename : DEFAULT_CHUNK_FILENAME ,
5967 path : this . _distPath ,
6068 library : {
6169 name : libraryName ,
You can’t perform that action at this time.
0 commit comments