From 37351522cd73e2877b2731326e1cfa860872e429 Mon Sep 17 00:00:00 2001 From: Sam Becker Date: Mon, 26 Feb 2024 18:20:25 -0600 Subject: [PATCH] Stop minimization on non-production builds --- next.config.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/next.config.js b/next.config.js index f404c1a0..4520e734 100644 --- a/next.config.js +++ b/next.config.js @@ -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')({