Use default cache groups chunks
[MAILPOET-3214]
This commit is contained in:
committed by
Veljko V
parent
c7e4e7d2bd
commit
952e18c25b
@@ -75,6 +75,7 @@ jQuery('#adminmenu #toplevel_page_mailpoet-newsletters')
|
|||||||
|
|
||||||
<!-- javascripts -->
|
<!-- javascripts -->
|
||||||
<%= javascript(
|
<%= javascript(
|
||||||
|
'runtime.js',
|
||||||
'vendor.js',
|
'vendor.js',
|
||||||
'mailpoet.js'
|
'mailpoet.js'
|
||||||
)%>
|
)%>
|
||||||
@@ -162,7 +163,6 @@ jQuery('#adminmenu #toplevel_page_mailpoet-newsletters')
|
|||||||
|
|
||||||
<% block after_translations %><% endblock %>
|
<% block after_translations %><% endblock %>
|
||||||
<%= javascript(
|
<%= javascript(
|
||||||
'admin_vendor_chunk.js',
|
|
||||||
'admin_vendor.js'
|
'admin_vendor.js'
|
||||||
)%>
|
)%>
|
||||||
|
|
||||||
|
@@ -286,44 +286,16 @@ const adminConfig = {
|
|||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
optimization: {
|
optimization: {
|
||||||
runtimeChunk: {
|
runtimeChunk: 'single',
|
||||||
name: 'vendor',
|
|
||||||
},
|
|
||||||
splitChunks: {
|
splitChunks: {
|
||||||
cacheGroups: {
|
cacheGroups: {
|
||||||
chunks: 'all',
|
chunks: 'all',
|
||||||
default: false,
|
},
|
||||||
vendors: false,
|
|
||||||
vendor: {
|
|
||||||
name: 'vendor',
|
|
||||||
chunks: (chunk) => chunk.name === 'vendor',
|
|
||||||
priority: 1,
|
|
||||||
enforce: true,
|
|
||||||
},
|
|
||||||
admin_vendor_chunk: {
|
|
||||||
name: 'admin_vendor_chunk',
|
|
||||||
test: (module, chunks) => {
|
|
||||||
// add all modules from 'admin_vendor' entrypoint
|
|
||||||
if (chunks.some((chunk) => chunk.name === 'admin_vendor')) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// add admin/form_editor_legacy/newsletter_editor shared modules
|
|
||||||
const filteredChunks = chunks.filter((chunk) => {
|
|
||||||
return ['admin', 'newsletter_editor', 'form_editor', 'settings'].includes(chunk.name);
|
|
||||||
});
|
|
||||||
return filteredChunks.length > 1;
|
|
||||||
},
|
|
||||||
enforce: true,
|
|
||||||
chunks: (chunk) => ['admin_vendor', 'admin', 'newsletter_editor'].includes(chunk.name),
|
|
||||||
priority: 0,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
externals: {
|
externals: {
|
||||||
'jquery': 'jQuery',
|
'jquery': 'jQuery',
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
// Public config
|
// Public config
|
||||||
|
Reference in New Issue
Block a user