Unverified Commit a6817d75 authored by Luke Sandberg's avatar Luke Sandberg Committed by GitHub

Don't expliclitly set the `--turbopack` flag in Create Next App, it is no longer necessary (#85117)

Next 16 makes turbopack the default. So drop the `--turbopack`, its cleaner.
parent 23034d4e
...@@ -199,7 +199,7 @@ export const installTemplate = async ({ ...@@ -199,7 +199,7 @@ export const installTemplate = async ({
/** Copy the version from package.json or override for tests. */ /** Copy the version from package.json or override for tests. */
const version = process.env.NEXT_PRIVATE_TEST_VERSION ?? pkg.version; 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. */ /** Create a package.json for the new project and write it to disk. */
const packageJson: any = { const packageJson: any = {
......
...@@ -253,8 +253,8 @@ describe('create-next-app prompts', () => { ...@@ -253,8 +253,8 @@ describe('create-next-app prompts', () => {
const pkg = require(join(cwd, projectName, 'package.json')) const pkg = require(join(cwd, projectName, 'package.json'))
expect(pkg.name).toBe(projectName) expect(pkg.name).toBe(projectName)
// Verify turbopack is in dev script // Verify webpack is not in dev script
expect(pkg.scripts.dev).toContain('--turbo') expect(pkg.scripts.dev).not.toContain('--webpack')
}) })
}) })
......
...@@ -156,7 +156,7 @@ describe('create-next-app --api (Headless App)', () => { ...@@ -156,7 +156,7 @@ describe('create-next-app --api (Headless App)', () => {
}) })
}) })
;(process.env.NEXT_RSPACK ? it.skip : it)( ;(process.env.NEXT_RSPACK ? it.skip : it)(
'should enable turbopack dev with --turbopack flag', 'should enable webpack dev with --webpack flag',
async () => { async () => {
await useTempDir(async (cwd) => { await useTempDir(async (cwd) => {
const projectName = 'app-turbo' const projectName = 'app-turbo'
...@@ -165,7 +165,7 @@ describe('create-next-app --api (Headless App)', () => { ...@@ -165,7 +165,7 @@ describe('create-next-app --api (Headless App)', () => {
projectName, projectName,
'--ts', '--ts',
'--api', '--api',
'--turbopack', '--webpack',
'--no-src-dir', '--no-src-dir',
'--no-import-alias', '--no-import-alias',
], ],
...@@ -180,7 +180,7 @@ describe('create-next-app --api (Headless App)', () => { ...@@ -180,7 +180,7 @@ describe('create-next-app --api (Headless App)', () => {
const projectRoot = join(cwd, projectName) const projectRoot = join(cwd, projectName)
const pkgJson = require(join(projectRoot, 'package.json')) const pkgJson = require(join(projectRoot, 'package.json'))
// eslint-disable-next-line jest/no-standalone-expect // 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({ await tryNextDev({
cwd, cwd,
......
...@@ -237,7 +237,7 @@ describe('create-next-app --app (App Router)', () => { ...@@ -237,7 +237,7 @@ describe('create-next-app --app (App Router)', () => {
}) })
}) })
;(process.env.NEXT_RSPACK ? it.skip : it)( ;(process.env.NEXT_RSPACK ? it.skip : it)(
'should enable turbopack dev with --turbopack flag', 'should enable webpack dev with --webpack flag',
async () => { async () => {
await useTempDir(async (cwd) => { await useTempDir(async (cwd) => {
const projectName = 'app-turbo' const projectName = 'app-turbo'
...@@ -247,7 +247,7 @@ describe('create-next-app --app (App Router)', () => { ...@@ -247,7 +247,7 @@ describe('create-next-app --app (App Router)', () => {
'--ts', '--ts',
'--app', '--app',
'--eslint', '--eslint',
'--turbopack', '--webpack',
'--no-src-dir', '--no-src-dir',
'--no-tailwind', '--no-tailwind',
'--no-import-alias', '--no-import-alias',
...@@ -264,7 +264,7 @@ describe('create-next-app --app (App Router)', () => { ...@@ -264,7 +264,7 @@ describe('create-next-app --app (App Router)', () => {
const projectRoot = join(cwd, projectName) const projectRoot = join(cwd, projectName)
const pkgJson = require(join(projectRoot, 'package.json')) const pkgJson = require(join(projectRoot, 'package.json'))
// eslint-disable-next-line jest/no-standalone-expect // eslint-disable-next-line jest/no-standalone-expect
expect(pkgJson.scripts.dev).toBe('next dev --turbopack') expect(pkgJson.scripts.dev).toBe('next dev --webpack')
}) })
} }
) )
......
...@@ -248,7 +248,7 @@ describe('create-next-app --no-app (Pages Router)', () => { ...@@ -248,7 +248,7 @@ describe('create-next-app --no-app (Pages Router)', () => {
}) })
}) })
;(process.env.NEXT_RSPACK ? it.skip : it)( ;(process.env.NEXT_RSPACK ? it.skip : it)(
'should enable turbopack dev with --turbopack flag', 'should enable webpack dev with --webpack flag',
async () => { async () => {
await useTempDir(async (cwd) => { await useTempDir(async (cwd) => {
const projectName = 'pages-turbo' const projectName = 'pages-turbo'
...@@ -258,7 +258,7 @@ describe('create-next-app --no-app (Pages Router)', () => { ...@@ -258,7 +258,7 @@ describe('create-next-app --no-app (Pages Router)', () => {
'--ts', '--ts',
'--no-app', '--no-app',
'--eslint', '--eslint',
'--turbopack', '--webpack',
'--no-src-dir', '--no-src-dir',
'--no-tailwind', '--no-tailwind',
'--no-import-alias', '--no-import-alias',
...@@ -275,7 +275,7 @@ describe('create-next-app --no-app (Pages Router)', () => { ...@@ -275,7 +275,7 @@ describe('create-next-app --no-app (Pages Router)', () => {
const projectRoot = join(cwd, projectName) const projectRoot = join(cwd, projectName)
const pkgJson = require(join(projectRoot, 'package.json')) const pkgJson = require(join(projectRoot, 'package.json'))
// eslint-disable-next-line jest/no-standalone-expect // eslint-disable-next-line jest/no-standalone-expect
expect(pkgJson.scripts.dev).toBe('next dev --turbopack') expect(pkgJson.scripts.dev).toBe('next dev --webpack')
}) })
} }
) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment