Skip to content

Commit 90eb5a7

Browse files
committed
Turbopack build: Add marker for when a build used Turbopack
1 parent b8ee3ce commit 90eb5a7

File tree

5 files changed

+31
-0
lines changed

5 files changed

+31
-0
lines changed

packages/next/src/build/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1452,6 +1452,7 @@ export default async function build(
14521452
let shutdownPromise = Promise.resolve()
14531453
if (!isGenerateMode) {
14541454
if (turboNextBuild) {
1455+
await writeFileUtf8(path.join(distDir, 'IS_TURBOPACK_BUILD'), '')
14551456
const {
14561457
duration: compilerDuration,
14571458
shutdownPromise: p,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { ReactNode } from 'react'
2+
export default function Root({ children }: { children: ReactNode }) {
3+
return (
4+
<html>
5+
<body>{children}</body>
6+
</html>
7+
)
8+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export default function Page() {
2+
return <p>hello world</p>
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/**
2+
* @type {import('next').NextConfig}
3+
*/
4+
const nextConfig = {}
5+
6+
module.exports = nextConfig
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { nextTestSetup } from 'e2e-utils'
2+
;(process.env.TURBOPACK ? describe : describe.skip)(
3+
'turbopack-build-marker',
4+
() => {
5+
const { next } = nextTestSetup({
6+
files: __dirname,
7+
})
8+
9+
it('should have Turbopack build marker', async () => {
10+
expect(await next.hasFile('.next/IS_TURBOPACK_BUILD')).toBe(true)
11+
})
12+
}
13+
)

0 commit comments

Comments
 (0)