- 升级 Next.js 配置,移除 webpackBuildWorker 实验特性 - 更新 Tailwind 设计令牌系统,对齐新品牌色与字体 - 配置 TypeScript strict 模式 (noUncheckedIndexedAccess) - 更新 ESLint 规则与 Jest 测试配置 - 添加 prisma.config.ts 数据库配置
38 lines
841 B
JavaScript
38 lines
841 B
JavaScript
const cdnDomain = process.env.CDN_DOMAIN || '';
|
|
|
|
const nextConfig = {
|
|
distDir: 'dist',
|
|
assetPrefix: cdnDomain || undefined,
|
|
images: {
|
|
unoptimized: true,
|
|
formats: ['image/avif', 'image/webp'],
|
|
},
|
|
compress: true,
|
|
poweredByHeader: false,
|
|
reactStrictMode: true,
|
|
experimental: {
|
|
optimizePackageImports: ['lucide-react', 'framer-motion'],
|
|
},
|
|
compiler: {
|
|
removeConsole: process.env.NODE_ENV === 'production',
|
|
},
|
|
generateEtags: true,
|
|
httpAgentOptions: {
|
|
keepAlive: true,
|
|
},
|
|
async headers() {
|
|
return [
|
|
{
|
|
source: '/(.*)',
|
|
headers: [
|
|
{ key: 'X-Content-Type-Options', value: 'nosniff' },
|
|
{ key: 'X-Frame-Options', value: 'DENY' },
|
|
{ key: 'X-XSS-Protection', value: '1; mode=block' },
|
|
],
|
|
},
|
|
];
|
|
},
|
|
};
|
|
|
|
export default nextConfig;
|