From 8376fe2b4d34d622e1fc71ae6e40ab47f2220569 Mon Sep 17 00:00:00 2001 From: Frederik Leonhardt Date: Fri, 3 May 2024 16:23:31 +1200 Subject: [PATCH] Enable webpack bundle optimisations --- webpack.config.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/webpack.config.js b/webpack.config.js index 2b7e592..0a61423 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -50,8 +50,21 @@ module.exports = (env, argv) => { extensions: ['.tsx', '.ts', '.js'], }, output: { - filename: 'bundle.js', + filename: '[name].[contenthash].js', path: path.resolve(__dirname, 'build/dist'), }, + optimization: { + moduleIds: 'deterministic', + runtimeChunk: 'single', + splitChunks: { + cacheGroups: { + vendor: { + test: /[\\/]node_modules[\\/]/, + name: 'vendors', + chunks: 'all', + }, + }, + }, + }, }; };