Stop minimization on non-production builds

This commit is contained in:
Sam Becker 2024-02-26 18:20:25 -06:00
parent 6096eb75b3
commit 37351522cd

View File

@ -38,6 +38,13 @@ const nextConfig = {
...process.env.NEXT_PUBLIC_STATICALLY_OPTIMIZE === '1' && {
experimental: { ppr: true },
},
webpack: (config) => {
config.optimization ??= {};
if (process.env.NODE_ENV !== 'production') {
config.optimization.minimize = false;
}
return config;
},
};
const withBundleAnalyzer = require('@next/bundle-analyzer')({