diff --git a/docs/02-app/01-building-your-application/06-optimizing/06-bundle-analyzer.mdx b/docs/02-app/01-building-your-application/06-optimizing/06-bundle-analyzer.mdx index 3a71bb1a8ce46..cb46ac5470fbe 100644 --- a/docs/02-app/01-building-your-application/06-optimizing/06-bundle-analyzer.mdx +++ b/docs/02-app/01-building-your-application/06-optimizing/06-bundle-analyzer.mdx @@ -24,14 +24,13 @@ pnpm add @next/bundle-analyzer Then, add the bundle analyzer's settings to your `next.config.js`. ```js filename="next.config.js" -const withBundleAnalyzer = require('@next/bundle-analyzer')({ - enabled: process.env.ANALYZE === 'true', -}) - /** @type {import('next').NextConfig} */ const nextConfig = {} -module.exports = withBundleAnalyzer(nextConfig) +const withBundleAnalyzer = require('@next/bundle-analyzer')() + +module.exports = + process.env.ANALYZE === 'true' ? withBundleAnalyzer(nextConfig) : nextConfig ``` ## Analyzing your bundles