Turbopack: What's New in Next.js 16.2
Key Points
- Server Fast Refresh enabled by default
- Subresource Integrity (SRI) support
- Dynamic imports are tree-shaken
Summary
Next.js 16.2 advances Turbopack with developer-facing features, compatibility fixes, and performance optimizations. Key additions include a new Server Fast Refresh (enabled by default), proper Web Worker origins to unblock WASM and relative fetches, Subresource Integrity (SRI) support, tree shaking for destructured dynamic imports, per-import loader attributes, Lightning CSS configuration options, log filtering, and support for postcss.config.ts. The release also contains 200+ bug fixes and internal optimizations to reduce build time and memory usage.
Key Points
-
Server Fast Refresh
- Server-side hot reload now uses Turbopack's module graph to reload only changed modules (enabled by default).
- Real-world refresh and compile times improved substantially (examples: up to 375% faster refresh, 400–900% faster compile inside Next.js).
- Proxy and Route Handlers will be supported in a future update.
-
Web Worker Origin
- Worker bootstrap now sets
location.originto your domain (notblob:), enablingimportScripts()and relativefetch()for WASM/worker libraries.
- Worker bootstrap now sets
-
Subresource Integrity (SRI)
- Build-time SRI hashes are supported via
experimental.srito allow integrity-checked script loading without per-request nonces. - Example:
experimental: { sri: { algorithm: 'sha256' } }innext.config.js.
- Build-time SRI hashes are supported via
-
Tree shaking of dynamic imports
- Destructured
await import('./lib')is tree-shaken like static imports; unused exports are removed.
- Destructured
-
Inline loader configuration
- Per-import loader attributes supported with
with { turbopackLoader, turbopackLoaderOptions, turbopackAs, turbopackModuleType }. - Prefer
next.config.*rules for portability; inline attrs useful for generated code or edge cases.
- Per-import loader attributes supported with
-
Lightning CSS configuration
- Experimental
lightningCssFeatureslets youinclude/excludespecific CSS transforms (e.g.,light-dark,oklab-colors,nesting).
- Experimental
-
Log filtering
- Use
turbopack.ignoreIssueinnext.configto suppress noisy or expected warnings by path, title, or pattern.
- Use
-
Other
postcss.config.tsis supported in addition to.js/.cjsvariants.- 200+ fixes and internal improvements: better diagnostics, reduced memory use, faster builds.
Actions for engineers
- No opt-in needed for Server Fast Refresh; verify dev reload behavior and report regressions via GitHub Issues.
- Enable SRI in
next.configif you need precomputed script integrity hashes. - Migrate any generated or special-case imports to inline loader attributes when necessary; otherwise prefer central config.
- Add
turbopack.ignoreIssuepatterns to silence expected warnings from vendors or generated code. - Test Worker-based WASM code; relative fetch/importScripts should now work without changes.
Feedback
Report issues or feature requests on the project GitHub (Issues/Discussions) or join the community Discord.