Skip to content

feat: add turbopack support for Next.js v15#44

Merged
Ethan-Arrowood merged 2 commits into
feat/turbopack-support-v16from
feat/turbopack-support-v15
May 6, 2026
Merged

feat: add turbopack support for Next.js v15#44
Ethan-Arrowood merged 2 commits into
feat/turbopack-support-v16from
feat/turbopack-support-v15

Conversation

@Ethan-Arrowood
Copy link
Copy Markdown
Member

Summary

  • Refactors the webpack: boolean plugin option (from feat: add turbopack support for Next.js v16 #43) into a bundler option that accepts "webpack" or "turbopack" with version-aware defaults:
    • v16: defaults to turbopack (matches Next.js v16 default)
    • v15: defaults to webpack (matches Next.js v15 default)
    • v14: defaults to webpack (no turbopack support)
  • Users can now set bundler: turbopack for v15 to opt into turbopack, or bundler: webpack for v16 to stay on webpack
  • Removes the hardcoded turbopack: false from v15 build and serve paths
  • Adds next-15-turbopack fixture and integration test

Test plan

  • npm run build — TypeScript compiles clean
  • next-15.pw.ts — webpack (default): 3/3 passed
  • next-15-turbopack.pw.ts — turbopack (explicit bundler: turbopack): 3/3 passed
  • next-16.pw.ts — turbopack (default): 3/3 passed
  • next-16-webpack.pw.ts — webpack (explicit bundler: webpack): 3/3 passed

🤖 Generated with Claude Code

Ethan-Arrowood and others added 2 commits May 6, 2026 08:54
Replace the `webpack: boolean` plugin option with a `bundler` option
that accepts "webpack" or "turbopack". The default is version-aware:
- v16: turbopack (matches Next.js v16 default)
- v15: webpack (matches Next.js v15 default)
- v14: webpack (no turbopack support)

Users can now explicitly set `bundler: turbopack` for v15 to opt in,
or `bundler: webpack` for v16 to opt out.

- Add `next-15-turbopack` fixture and integration test
- Update `next-16-webpack` fixture to use `bundler: webpack`

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Next.js v14 does not support turbopack via the createServer or
nextBuild APIs. Log an error and fall back to webpack if a user
sets `bundler: turbopack` with a v14 application.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Ethan-Arrowood Ethan-Arrowood merged commit 88d69ec into feat/turbopack-support-v16 May 6, 2026
6 checks passed
@Ethan-Arrowood Ethan-Arrowood deleted the feat/turbopack-support-v15 branch May 6, 2026 16:06
Ethan-Arrowood added a commit that referenced this pull request May 6, 2026
* feat: add turbopack support for Next.js v16

Next.js v16 defaults to Turbopack. The plugin previously hardcoded
webpack for both build and serve, disabling turbopack entirely.

- Add `webpack` boolean plugin option (defaults to false) so users can
  opt into webpack when needed, mirroring the `next build --webpack` CLI flag
- Update `withHarper()` to include a `turbopack` config key, preventing
  Next.js v16 from erroring when it sees a webpack config without one
- Add `next-16-webpack` fixture and integration test to cover both bundler paths

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* add allowImportingTsExtensions for integration testing tsconfig

* feat: add turbopack support for Next.js v15 (#44)

* feat: add turbopack support for Next.js v15 and refactor bundler option

Replace the `webpack: boolean` plugin option with a `bundler` option
that accepts "webpack" or "turbopack". The default is version-aware:
- v16: turbopack (matches Next.js v16 default)
- v15: webpack (matches Next.js v15 default)
- v14: webpack (no turbopack support)

Users can now explicitly set `bundler: turbopack` for v15 to opt in,
or `bundler: webpack` for v16 to opt out.

- Add `next-15-turbopack` fixture and integration test
- Update `next-16-webpack` fixture to use `bundler: webpack`

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat: add v14 turbopack guard and validate all versions (#45)

Next.js v14 does not support turbopack via the createServer or
nextBuild APIs. Log an error and fall back to webpack if a user
sets `bundler: turbopack` with a v14 application.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* docs: document bundler option in README

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant