feat(next.config): add console log removal configuration for production

This commit is contained in:
zhsama 2025-10-30 16:16:11 +08:00
parent 57c65ec625
commit 282fde9a04
1 changed files with 6 additions and 0 deletions

View File

@ -1,4 +1,7 @@
const { codeInspectorPlugin } = require('code-inspector-plugin')
const isDev = process.env.NODE_ENV === 'development'
const withPWA = require('next-pwa')({
dest: 'public',
register: true,
@ -137,6 +140,9 @@ const nextConfig = {
]
},
output: 'standalone',
compiler: {
removeConsole: isDev ? false : { exclude: ['warn', 'error'] },
}
}
module.exports = withPWA(withBundleAnalyzer(withMDX(nextConfig)))