Skip to content

Commit d86ddfb

Browse files
committed
flip the default for custom servers
1 parent 97056e0 commit d86ddfb

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

packages/next/src/server/next.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,13 +534,20 @@ function createServer(
534534
options: NextServerOptions & {
535535
turbo?: boolean
536536
turbopack?: boolean
537+
webpack?: boolean
537538
}
538539
): NextWrapperServer {
539540
if (
540541
options &&
541542
(options.turbo || options.turbopack || process.env.IS_TURBOPACK_TEST)
542543
) {
544+
if (options.webpack) {
545+
throw new Error('Pass either webpack or turbopack, not both.')
546+
}
543547
process.env.TURBOPACK = '1'
548+
} else if (!options.webpack) {
549+
// If no options are set we default to turbopack
550+
process.env.TURBOPACK = 'auto'
544551
}
545552
// The package is used as a TypeScript plugin.
546553
if (

0 commit comments

Comments
 (0)