Skip to content

Commit 8be4e43

Browse files
authored
[turbopack] No op the webpack bundle analyzer under turbopack (#84614)
This never worked with turbopack, but with the recent default flip using this now breaks the build since it complains about configuring webpack in a turbopack build. So print a warning and no-op the analyzer. This isn't ideal but it is more actionable than a crash for users.
1 parent 69e3e62 commit 8be4e43

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

packages/next-bundle-analyzer/index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ module.exports =
44
if (!enabled) {
55
return nextConfig
66
}
7+
if (process.env.TURBOPACK) {
8+
console.warn(
9+
'The Next Bundle Analyzer is not compatible with Turbopack builds yet, no report will be generated.\n\n' +
10+
'To run this analysis pass the `--webpack` flag to `next build`'
11+
)
12+
return nextConfig
13+
}
714

815
const extension = analyzerMode === 'json' ? '.json' : '.html'
916

0 commit comments

Comments
 (0)