Repository: vercel/next.js
Pull request: Don't expliclitly set the `--turbopack` flag in Create Next App, it is no longer necessary

Next 16 makes turbopack the default. So drop the `--turbopack`, its cleaner.

Closes PACK-5724

Changed files:
filename: packages/create-next-app/templates/index.ts
patch: @@ -199,7 +199,7 @@ export const installTemplate = async ({
 
   /** Copy the version from package.json or override for tests. */
   const version = process.env.NEXT_PRIVATE_TEST_VERSION ?? pkg.version;
-  const bundlerFlags = `${bundler === Bundler.Turbopack ? " --turbopack" : ""}${bundler === Bundler.Webpack ? " --webpack" : ""}`;
+  const bundlerFlags = bundler === Bundler.Webpack ? " --webpack" : "";
 
   /** Create a package.json for the new project and write it to disk. */
   const packageJson: any = {

filename: test/integration/create-next-app/prompts.test.ts
patch: @@ -253,8 +253,8 @@ describe('create-next-app prompts', () => {
 
       const pkg = require(join(cwd, projectName, 'package.json'))
       expect(pkg.name).toBe(projectName)
-      // Verify turbopack is in dev script
-      expect(pkg.scripts.dev).toContain('--turbo')
+      // Verify webpack is not in dev script
+      expect(pkg.scripts.dev).not.toContain('--webpack')
     })
   })
 

filename: test/integration/create-next-app/templates/app-api.test.ts
patch: @@ -156,7 +156,7 @@ describe('create-next-app --api (Headless App)', () => {
     })
   })
   ;(process.env.NEXT_RSPACK ? it.skip : it)(
-    'should enable turbopack dev with --turbopack flag',
+    'should enable webpack dev with --webpack flag',
     async () => {
       await useTempDir(async (cwd) => {
         const projectName = 'app-turbo'
@@ -165,7 +165,7 @@ describe('create-next-app --api (Headless App)', () => {
             projectName,
             '--ts',
             '--api',
-            '--turbopack',
+            '--webpack',
             '--no-src-dir',
             '--no-import-alias',
           ],
@@ -180,7 +180,7 @@ describe('create-next-app --api (Headless App)', () => {
         const projectRoot = join(cwd, projectName)
         const pkgJson = require(join(projectRoot, 'package.json'))
         // eslint-disable-next-line jest/no-standalone-expect
-        expect(pkgJson.scripts.dev).toBe('next dev --turbopack')
+        expect(pkgJson.scripts.dev).toBe('next dev --webpack')
 
         await tryNextDev({
           cwd,

filename: test/integration/create-next-app/templates/app.test.ts
patch: @@ -237,7 +237,7 @@ describe('create-next-app --app (App Router)', () => {
     })
   })
   ;(process.env.NEXT_RSPACK ? it.skip : it)(
-    'should enable turbopack dev with --turbopack flag',
+    'should enable webpack dev with --webpack flag',
     async () => {
       await useTempDir(async (cwd) => {
         const projectName = 'app-turbo'
@@ -247,7 +247,7 @@ describe('create-next-app --app (App Router)', () => {
             '--ts',
             '--app',
             '--eslint',
-            '--turbopack',
+            '--webpack',
             '--no-src-dir',
             '--no-tailwind',
             '--no-import-alias',
@@ -264,7 +264,7 @@ describe('create-next-app --app (App Router)', () => {
         const projectRoot = join(cwd, projectName)
         const pkgJson = require(join(projectRoot, 'package.json'))
         // eslint-disable-next-line jest/no-standalone-expect
-        expect(pkgJson.scripts.dev).toBe('next dev --turbopack')
+        expect(pkgJson.scripts.dev).toBe('next dev --webpack')
       })
     }
   )

filename: test/integration/create-next-app/templates/pages.test.ts
patch: @@ -248,7 +248,7 @@ describe('create-next-app --no-app (Pages Router)', () => {
     })
   })
   ;(process.env.NEXT_RSPACK ? it.skip : it)(
-    'should enable turbopack dev with --turbopack flag',
+    'should enable webpack dev with --webpack flag',
     async () => {
       await useTempDir(async (cwd) => {
         const projectName = 'pages-turbo'
@@ -258,7 +258,7 @@ describe('create-next-app --no-app (Pages Router)', () => {
             '--ts',
             '--no-app',
             '--eslint',
-            '--turbopack',
+            '--webpack',
             '--no-src-dir',
             '--no-tailwind',
             '--no-import-alias',
@@ -275,7 +275,7 @@ describe('create-next-app --no-app (Pages Router)', () => {
         const projectRoot = join(cwd, projectName)
         const pkgJson = require(join(projectRoot, 'package.json'))
         // eslint-disable-next-line jest/no-standalone-expect
-        expect(pkgJson.scripts.dev).toBe('next dev --turbopack')
+        expect(pkgJson.scripts.dev).toBe('next dev --webpack')
       })
     }
   )