diff --git a/next.config.ts b/next.config.ts index 3ea427424..3e3a554fa 100644 --- a/next.config.ts +++ b/next.config.ts @@ -5,6 +5,12 @@ import { version as PKG_VERSION } from "./package.json"; const nextConfig: NextConfig = { output: "standalone", + // `next build` type-checks the whole tsconfig program since 16.3, which + // reaches the unit tests under `src/**/__tests__` and their fixtures under + // `tests/`. The image build context leaves `tests/` and `e2e/` out on + // purpose, so the build reads a tsconfig without them; `pnpm typecheck` + // still covers the full program. + typescript: { tsconfigPath: "tsconfig.build.json" }, poweredByHeader: false, // v1.4.38.4 — expose the package.json version to the client bundle // so the `` can compare the shell-baked version diff --git a/tsconfig.build.json b/tsconfig.build.json new file mode 100644 index 000000000..88451f908 --- /dev/null +++ b/tsconfig.build.json @@ -0,0 +1,17 @@ +{ + "extends": "./tsconfig.json", + "exclude": [ + "node_modules", + "scripts", + "tests", + "e2e", + "src/**/__tests__/**", + "src/**/*.test.ts", + "src/**/*.test.tsx", + "playwright.config.ts", + "vitest.config.ts", + "vitest.config.mts", + "vitest.integration.config.ts", + "vitest.integration.config.mts" + ] +}