| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- import type { NextConfig } from "next";
- import "./src/env";
- const configHeader = [
- // Security headers for all routes
- {
- source: "/:path*",
- headers: [
- { key: "Referrer-Policy", value: "strict-origin-when-cross-origin" },
- //{ key: "X-Frame-Options", value: "DENY" },
- { key: "X-Content-Type-Options", value: "nosniff" },
- // { key: "X-XSS-Protection", value: "1; mode=block" },
- // {
- // key: "Permissions-Policy",
- // value:
- // "camera=(), microphone=(), geolocation=(), browsing-topics=()",
- // },
- ],
- },
- // Cache dynamic pages - shorter cache for frequently updated content
- // Next.js static assets - long cache with immutable
- // Public folder assets - long cache
- ];
- const nextConfig: NextConfig = {
- output: "standalone",
- transpilePackages: ["@t3-oss/env-nextjs", "@t3-oss/env-core"],
- devIndicators: false,
- reactStrictMode: true,
- typescript: {
- ignoreBuildErrors: false,
- },
- images: {
- unoptimized: true,
- remotePatterns: [],
- },
- async headers() {
- return configHeader;
- },
- async rewrites() {
- return [
- {
- source: '/:slug.html',
- destination: '/product/:slug',
- },
- ];
- },
- compress: true,
- experimental: {
- optimizePackageImports: ["lodash", "date-fns"],
- serverActions: {
- bodySizeLimit: "2mb",
- },
- },
- };
- export default nextConfig;
|