From 2d151debb4724241a5ad72870e91ee9195100e5a Mon Sep 17 00:00:00 2001 From: kaiyou Date: Wed, 29 Jan 2025 10:50:55 +0100 Subject: [PATCH 1/2] Fix the webpack build due to dependOn issue As stated in Webpack documentation, when using multiple entrypoints and dependencies, it is recommended to export the runtime as a single separated chunk. See: https://webpack.js.org/guides/code-splitting/#entry-dependencies --- core/admin/assets/webpack.config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/core/admin/assets/webpack.config.js b/core/admin/assets/webpack.config.js index 8c3d6c27..58468002 100644 --- a/core/admin/assets/webpack.config.js +++ b/core/admin/assets/webpack.config.js @@ -60,6 +60,7 @@ module.exports = { ], optimization: { minimize: true, + runtimeChunk: 'single', minimizer: [ new terse(), new mini({ From 0a3f6e5c2f37692a8b4de129a92b858becb01b1d Mon Sep 17 00:00:00 2001 From: kaiyou Date: Wed, 29 Jan 2025 11:48:39 +0100 Subject: [PATCH 2/2] Previous fix only did delay the issue My previous fix attempt only made it clear that the issue was in the runtime and an upstream issue with Webpack, but did not really fix things. Since Webpack 5.96.0, especially since https://github.com/webpack/webpack/commit/420d0d0eed79b0c300f18466a47ed7bd5f4ff14b Webpack does not generate JS for asset chunks, which breaks having a single entry with both JS and asset chunks. The logo can easily be moved to a separate entry. --- core/admin/assets/webpack.config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/admin/assets/webpack.config.js b/core/admin/assets/webpack.config.js index 58468002..43417b20 100644 --- a/core/admin/assets/webpack.config.js +++ b/core/admin/assets/webpack.config.js @@ -9,10 +9,11 @@ module.exports = { mode: 'production', entry: { app: { - import: ['./assets/app.css', './assets/mailu.png', './assets/app.js'], + import: ['./assets/app.css', './assets/app.js'], dependOn: 'vendor', }, vendor: './assets/vendor.js', + logo: './assets/mailu.png', }, output: { path: path.resolve(__dirname, 'static/'), @@ -60,7 +61,6 @@ module.exports = { ], optimization: { minimize: true, - runtimeChunk: 'single', minimizer: [ new terse(), new mini({