Use commons chunk for JS code shared between entry points
This is a replacement for previous admin_vendor_chunk
see 422245e3e6/webpack.config.js (L235-L251)
The automatic splitting based on minChunks seems to give better results.
[MAILPOET-3214]
This commit is contained in:
committed by
Veljko V
parent
c6f9e240d8
commit
e1c84f8d6d
@@ -77,6 +77,7 @@ jQuery('#adminmenu #toplevel_page_mailpoet-newsletters')
|
||||
<%= javascript(
|
||||
'runtime.js',
|
||||
'vendor.js',
|
||||
'commons.js',
|
||||
'mailpoet.js'
|
||||
)%>
|
||||
|
||||
|
@@ -298,7 +298,11 @@ const adminConfig = {
|
||||
runtimeChunk: 'single',
|
||||
splitChunks: {
|
||||
cacheGroups: {
|
||||
chunks: 'all',
|
||||
commons: {
|
||||
name: 'commons',
|
||||
chunks: 'initial',
|
||||
minChunks: 2,
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
|
Reference in New Issue
Block a user