chore(config): 更新项目构建与测试配置

- 升级 Next.js 配置,移除 webpackBuildWorker 实验特性
- 更新 Tailwind 设计令牌系统,对齐新品牌色与字体
- 配置 TypeScript strict 模式 (noUncheckedIndexedAccess)
- 更新 ESLint 规则与 Jest 测试配置
- 添加 prisma.config.ts 数据库配置
This commit is contained in:
张翔
2026-07-07 06:51:48 +08:00
parent 415a103a24
commit c9de806109
11 changed files with 2902 additions and 115 deletions
+18 -2
View File
@@ -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;