From b5d48be01fdb0051ff54fc86872b540e93650ff1 Mon Sep 17 00:00:00 2001 From: HF Date: Mon, 11 Dec 2023 22:11:55 +0100 Subject: [PATCH] renaming entry points fixes different three.js compilations weirdly --- webpack.config.client.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/webpack.config.client.js b/webpack.config.client.js index cec75d82..d71ab274 100644 --- a/webpack.config.client.js +++ b/webpack.config.client.js @@ -53,18 +53,21 @@ function buildWebpackClientConfig( devtool: (development) ? 'inline-source-map' : false, entry: { - [`client.${locale}`]: + client: [path.resolve('src', 'client.js')], - [`globe.${locale}`]: + globe: [path.resolve('src', 'globe.js')], - [`popup.${locale}`]: + popup: [path.resolve('src', 'popup.js')], }, output: { path: path.resolve('dist', 'public', 'assets'), publicPath: '/assets/', - filename: `[name].[chunkhash:8].js`, + // chunkReason is set if it is a split chunk like vendor or three + filename: (pathData) => (pathData.chunk.chunkReason) + ? '[name].[chunkhash:8].js' + : `[name].${locale}.[chunkhash:8].js`, chunkFilename: `[name].${locale}.[chunkhash:8].js`, },