Some checks failed
lotteryfront CI / build (push) Has been cancelled
- 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
28 lines
700 B
TypeScript
28 lines
700 B
TypeScript
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;
|