-
Notifications
You must be signed in to change notification settings - Fork 30.5k
Labels
TurbopackRelated to Turbopack with Next.js.Related to Turbopack with Next.js.linear: turbopackConfirmed issue that is tracked by the Turbopack team.Confirmed issue that is tracked by the Turbopack team.
Description
Link to the code that reproduces this issue
To Reproduce
Create project with client component that imports large .ts file with loads of enum definitions that are not being used. (see listed repository
- In the listed repository, run
next build - check the Turbopack bundle output using the new analyze command:
next experimental-analyze large-utility.tswill be listed as ~20kb, none of the unused enums are stripped
Current vs. Expected behavior
I would expect the unused enums to be stripped from the final bundle just like next build --webpack
Provide environment information
Operating System:
Platform: win32
Arch: x64
Version: Windows 11 Pro
Available memory (MB): 63146
Available CPU cores: 16
Binaries:
Node: 24.11.0
npm: 11.6.1
Yarn: 1.22.22
pnpm: 9.15.5
Relevant Packages:
next: 16.1.1 // Latest available version is detected (16.1.1).
eslint-config-next: N/A
react: 19.2.0
react-dom: 19.2.0
typescript: 5.9.3
Next.js Config:
output: N/AWhich area(s) are affected? (Select all that apply)
Turbopack
Which stage(s) are affected? (Select all that apply)
next build (local)
Additional context
In our large repository we have a lot of GraphQL-Codegen with enums, so in our case its adding ~300kb to the final output compared to webpack
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
TurbopackRelated to Turbopack with Next.js.Related to Turbopack with Next.js.linear: turbopackConfirmed issue that is tracked by the Turbopack team.Confirmed issue that is tracked by the Turbopack team.