Skip to content

feat: add v14 turbopack guard#45

Merged
Ethan-Arrowood merged 1 commit into
feat/turbopack-support-v15from
feat/turbopack-support-v14
May 6, 2026
Merged

feat: add v14 turbopack guard#45
Ethan-Arrowood merged 1 commit into
feat/turbopack-support-v15from
feat/turbopack-support-v14

Conversation

@Ethan-Arrowood
Copy link
Copy Markdown
Member

Summary

  • Next.js v14 does not expose turbopack via its createServer or nextBuild APIs (turbopack build was gated behind an internal TURBOPACK_BUILD env var and threw "next build doesn't support turbopack yet")
  • If a user sets bundler: turbopack on a v14 application, the plugin now logs an error and falls back to webpack instead of passing unsupported options

Test plan

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

All 15 tests pass across all 5 configurations.

🤖 Generated with Claude Code

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 32e4f5e into feat/turbopack-support-v15 May 6, 2026
6 checks passed
@Ethan-Arrowood Ethan-Arrowood deleted the feat/turbopack-support-v14 branch May 6, 2026 16:00
Ethan-Arrowood added a commit that referenced this pull request May 6, 2026
* 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>
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.

2 participants