diff --git a/views/layout.html b/views/layout.html
index d9143b4d98..e136a48188 100644
--- a/views/layout.html
+++ b/views/layout.html
@@ -75,6 +75,7 @@ jQuery('#adminmenu #toplevel_page_mailpoet-newsletters')
<%= javascript(
+ 'runtime.js',
'vendor.js',
'mailpoet.js'
)%>
@@ -162,7 +163,6 @@ jQuery('#adminmenu #toplevel_page_mailpoet-newsletters')
<% block after_translations %><% endblock %>
<%= javascript(
- 'admin_vendor_chunk.js',
'admin_vendor.js'
)%>
diff --git a/webpack.config.js b/webpack.config.js
index f50b042d8b..53aff3a237 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -286,44 +286,16 @@ const adminConfig = {
}),
],
optimization: {
- runtimeChunk: {
- name: 'vendor',
- },
+ runtimeChunk: 'single',
splitChunks: {
cacheGroups: {
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: {
'jquery': 'jQuery',
- }
+ },
};
// Public config