Skip to content

Commit

Permalink
Chore: speed up dev build (#4592)
Browse files Browse the repository at this point in the history
  • Loading branch information
katspaugh authored Dec 3, 2024
1 parent 9e31418 commit 2bf0514
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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?$/] },
Expand Down Expand Up @@ -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
},
}
Expand Down

0 comments on commit 2bf0514

Please sign in to comment.