Files
Jyotisha/frontend/next.config.ts
T
ClaudeandClaude Opus 5.5 c02b1fc46b fix(build): next build never reuses Turbopack's persistent cache, which served the previous globals.css (BUG-2136)
Next 16.3.1 turns on turbopackFileSystemCacheForBuild by default and keeps it in
.next/cache/turbopack, inside the image build's BuildKit cache mount. Reproduced
locally: a cold build at e8e358213, then a build at 0bf3210c8 reusing only
.next/cache, lost the four .birth-place-coordinate* classes exactly as CI did.
With the cache off the same rebuild carries every class; Turbopack compile time
is 21.0 s either way. Recurrence of BUG-2069, whose cache-id rename only reset
the cache once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DbBXoyn7Hj3LCW3BUs5bZ8
2026-11-21 23:59:55 +08:00

64 lines
2.1 KiB
TypeScript

import path from "node:path";
import type { NextConfig } from "next";
const repositoryRoot = path.join(process.cwd(), "..");
const nextConfig: NextConfig = {
deploymentId: process.env.NEXT_DEPLOYMENT_ID,
async headers() {
return [
{
source: "/",
headers: [{ key: "Cache-Control", value: "private, no-store, must-revalidate" }],
},
{
source: "/login",
headers: [{ key: "Cache-Control", value: "private, no-store, must-revalidate" }],
},
{
// Heading serif slices: content-hashed names, same URL across deploys
// (no `?dpl=`), so a browser downloads each one once (BUG-1128).
source: "/fonts/serif-sc/:path*",
headers: [{ key: "Cache-Control", value: "public, max-age=31536000, immutable" }],
},
];
},
devIndicators: false,
experimental: {
authInterrupts: true,
// BUG-2136: Next 16 keeps a persistent Turbopack cache for `next build` by default
// (.next/cache/turbopack). The image build mounts .next/cache across builds, and a warm
// build reused the previous compiled globals.css after its rules changed (BUG-2069 on
// e4b25c26, again on 0bf3210c8; reproduced locally: e8e358213 → 0bf3210c8 lost the four
// .birth-place-coordinate* classes). Compile time is the same without it (21.0 s both ways).
turbopackFileSystemCacheForBuild: false,
optimizePackageImports: [
"@ant-design/icons",
"@refinedev/antd",
"@refinedev/core",
"antd",
"date-fns",
"lucide-react",
],
},
output: "standalone",
turbopack: { root: repositoryRoot },
outputFileTracingRoot: repositoryRoot,
outputFileTracingIncludes: {
"/api/consult": [
"../SKILL.md",
"../references/**/*",
"../scripts/**/*",
"../assets/**/*",
],
},
async redirects() {
return [
{ source: "/membership", destination: "/?settings=billing&source=legacy", permanent: false },
{ source: "/membership/orders", destination: "/?settings=billing&tab=orders", permanent: false },
];
},
};
export default nextConfig;