Files
Jyotisha/frontend/next.config.ts
T
Jesse_ChenandClaude Opus 5.5 8112f62b51 perf(fonts): heading serif slices served from public/ under content-hashed names, cached for good (BUG-1128)
Bundled media carry Next's per-deploy ?dpl= and were downloaded again after
every release. Bytes unchanged; /fonts/serif-sc/* is immutable. Overturns the
serif-headings contract line "bundled by Next, not served from public/"
per TASK-home-first-load-20260930 decision 2.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N4f2nya58RoRu4yEmJgRGE
2026-10-01 00:40:11 +08:00

58 lines
1.6 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,
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;