import path from "node:path"; import type { NextConfig } from "next"; // 다층 캐시·SEO 차단(§4)의 응답 헤더 계층. immutable 정적 자산(_next/static, _next/image)은 // Next.js가 자체적으로 Cache-Control을 강제하므로 대상에서 제외해 자산 캐싱을 보존한다. const SECURITY_HEADERS = [ { key: "X-Robots-Tag", value: "noindex, nofollow, noarchive, nosnippet, noimageindex", }, { key: "Cache-Control", value: "no-store, no-cache, must-revalidate" }, { key: "Pragma", value: "no-cache" }, { key: "X-Content-Type-Options", value: "nosniff" }, { key: "X-Frame-Options", value: "DENY" }, { key: "Referrer-Policy", value: "strict-origin-when-cross-origin" }, { key: "Permissions-Policy", value: "camera=(), microphone=(), geolocation=()", }, ]; const nextConfig: NextConfig = { // SCSS 로드 경로 — 프로젝트 루트를 Sass의 loadPaths에 넣어 `@use "@fox/styles/abstracts"` // 같은 루트 기준 절대 경로가 해석되게 한다. 이게 없으면 컴포넌트마다 `../../../` 상대 // 경로를 써야 해서 @fox 폴더를 다른 프로젝트로 통째로 복사할 수 없다(포터블 요건). // tsconfig의 `@fox/*` alias는 TS/번들러 전용이라 Sass 해석에는 관여하지 않으므로, // 같은 경로를 여기서 한 번 더 선언해야 TS와 SCSS의 import 표기가 일치한다. sassOptions: { loadPaths: [path.join(process.cwd())], }, async headers() { return [ { source: "/((?!_next/static|_next/image).*)", headers: SECURITY_HEADERS, }, ]; }, }; export default nextConfig;