chore(config): 更新项目构建与测试配置
- 升级 Next.js 配置,移除 webpackBuildWorker 实验特性 - 更新 Tailwind 设计令牌系统,对齐新品牌色与字体 - 配置 TypeScript strict 模式 (noUncheckedIndexedAccess) - 更新 ESLint 规则与 Jest 测试配置 - 添加 prisma.config.ts 数据库配置
This commit is contained in:
+18
-2
@@ -2,20 +2,36 @@ const cdnDomain = process.env.CDN_DOMAIN || '';
|
||||
|
||||
const nextConfig = {
|
||||
distDir: 'dist',
|
||||
output: 'export',
|
||||
assetPrefix: cdnDomain || undefined,
|
||||
images: {
|
||||
unoptimized: true,
|
||||
formats: ['image/avif', 'image/webp'],
|
||||
},
|
||||
compress: true,
|
||||
poweredByHeader: false,
|
||||
reactStrictMode: true,
|
||||
experimental: {
|
||||
optimizePackageImports: ['lucide-react'],
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user