Files
lotteryFront/next.config.ts
kang dd1155978a
Some checks failed
lotteryfront CI / build (push) Has been cancelled
feat: configure responsive image sizes for optimized loading
- Added custom deviceSizes configuration in next.config.ts to support common mobile and desktop breakpoints
- Added responsive sizes attribute to hall wallet strip background image for proper srcset generation
2026-06-26 09:30:44 +08:00

28 lines
700 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import type { NextConfig } from "next";
import { nonCspSecurityHeaders } from "./src/lib/csp-config";
import { parseAllowedDevOrigins } from "./src/lib/next-dev-origins";
const allowedDevOrigins = parseAllowedDevOrigins(process.env.ALLOWED_DEV_ORIGINS);
const nextConfig: NextConfig = {
...(allowedDevOrigins.length > 0 ? { allowedDevOrigins } : {}),
reactCompiler: true,
images: {
deviceSizes: [640, 750, 828, 1080, 1200, 1920],
},
// 非 CSP 安全头CSP 由 middleware 按后台接入站点白名单动态生成。
async headers() {
return [
{
source: "/:path*",
headers: nonCspSecurityHeaders,
},
];
},
};
export default nextConfig;