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 ({
/** 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 = {
......
......@@ -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')
})
})
......
......@@ -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,
......
......@@ -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')
})
}
)
......
......@@ -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')
})
}
)
......
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