🐛 Issue Report
Issue Summary
optimizePackageImports configured in next.config.js under apps/web does not appear to take effect when using Turbopack.
https://github.com/calcom/cal.com/blob/a17f28e9ab44d34a24840cff70082470d775b9b1/apps/web/next.config.ts#L236-L238
Based on investigation, this may be because Turbopack's support for optimizePackageImports is not fully implemented yet.
Related discussion: vercel/next.js#75148
Steps to Reproduce
- Create a Next.js app using Turbopack (e.g.
next dev --turbo)
- Configure
optimizePackageImports in next.config.js:
module.exports = {
experimental: {
optimizePackageImports: ['some-library'],
},
};
- Import from the configured package:
import { Button } from 'some-library';
- Start the dev server with Turbopack enabled
- Inspect the compiled output or bundle behavior
Actual Results
- The import is not optimized as expected
- No transformation or tree-shaking behavior related to
optimizePackageImports is observed
- Behavior appears identical to when the option is not configured
Expected Results
- Imports should be transformed into per-module imports (or equivalent optimized form)
- Bundle size / module resolution should reflect optimization
- Behavior should be consistent with Webpack-based Next.js builds
Technical details
- Next.js version: (please fill)
- Turbopack enabled: Yes (
next dev --turbo)
- Node.js version: (please fill)
- Browser: (please fill)
Additional notes:
- This may be related to incomplete feature parity between Turbopack and Webpack
- The behavior aligns with the discussion in the related issue above
Evidence
- Compared behavior with and without
optimizePackageImports — no observable difference
- Verified import output and bundle structure
- (Optional) Can provide reproduction repo if needed
Question
Is optimizePackageImports expected to work with Turbopack at this stage, or is this feature still under development?
🐛 Issue Report
Issue Summary
optimizePackageImportsconfigured innext.config.jsunderapps/webdoes not appear to take effect when using Turbopack.https://github.com/calcom/cal.com/blob/a17f28e9ab44d34a24840cff70082470d775b9b1/apps/web/next.config.ts#L236-L238
Based on investigation, this may be because Turbopack's support for
optimizePackageImportsis not fully implemented yet.Related discussion: vercel/next.js#75148
Steps to Reproduce
next dev --turbo)optimizePackageImportsinnext.config.js:Actual Results
optimizePackageImportsis observedExpected Results
Technical details
next dev --turbo)Additional notes:
Evidence
optimizePackageImports— no observable differenceQuestion
Is
optimizePackageImportsexpected to work with Turbopack at this stage, or is this feature still under development?