Skip to content

Commit e51dd81

Browse files
committed
Merge branch 'feature/async_common_chunk' into develop
2 parents be2cbed + 39f5853 commit e51dd81

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

template/build/webpack.prod.conf.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,16 @@ const webpackConfig = merge(baseWebpackConfig, {
9595
name: 'manifest',
9696
chunks: ['vendor']
9797
}),
98+
// This instance extracts shared chunks from code splitted chunks and bundles them
99+
// in a separate chunk, similar to the vendor chunk
100+
// see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk
101+
new webpack.optimize.CommonsChunkPlugin({
102+
name: 'app',
103+
async: 'vendor-async',
104+
children: true,
105+
minChunks: 3,
106+
}),
107+
98108
// copy custom static assets
99109
new CopyWebpackPlugin([
100110
{

0 commit comments

Comments
 (0)