Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cf038a3 commit ea0f516Copy full SHA for ea0f516
docs/02-app/01-building-your-application/06-optimizing/06-bundle-analyzer.mdx
@@ -24,14 +24,13 @@ pnpm add @next/bundle-analyzer
24
Then, add the bundle analyzer's settings to your `next.config.js`.
25
26
```js filename="next.config.js"
27
-const withBundleAnalyzer = require('@next/bundle-analyzer')({
28
- enabled: process.env.ANALYZE === 'true',
29
-})
30
-
31
/** @type {import('next').NextConfig} */
32
const nextConfig = {}
33
34
-module.exports = withBundleAnalyzer(nextConfig)
+const withBundleAnalyzer = require('@next/bundle-analyzer')()
+
+module.exports =
+ process.env.ANALYZE === 'true' ? withBundleAnalyzer(nextConfig) : nextConfig
35
```
36
37
## Analyzing your bundles
0 commit comments