From 2bf05141dee3a8f4e46b9ff6671fda580451724f Mon Sep 17 00:00:00 2001 From: katspaugh <381895+katspaugh@users.noreply.github.com> Date: Tue, 3 Dec 2024 10:40:51 +0100 Subject: [PATCH] Chore: speed up dev build (#4592) --- next.config.mjs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/next.config.mjs b/next.config.mjs index b867dc0049..b23c212339 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -47,7 +47,7 @@ const nextConfig = { '@gnosis.pm/zodiac', ], }, - webpack(config) { + webpack(config, { dev }) { config.module.rules.push({ test: /\.svg$/i, issuer: { and: [/\.(js|ts|md)x?$/] }, @@ -79,6 +79,21 @@ const nextConfig = { 'mainnet.json': path.resolve('./node_modules/@ethereumjs/common/dist.browser/genesisStates/mainnet.json'), } + if (dev) { + config.optimization.splitChunks = { + ...config.optimization.splitChunks, + cacheGroups: { + ...config.optimization.splitChunks.cacheGroups, + customModule: { + test: /[\\/]node_modules[\\/](@safe-global|ethers)[\\/]/, + name: 'protocol-kit-ethers', + chunks: 'all', + }, + }, + } + config.optimization.minimize = false + } + return config }, }