flnxi-Wu/next.config.js
WuYongJie ba98bf22cc feat: 添加许可证系统、Agent部署模块和Harbor镜像管理
- 新增许可证服务器 (license-server/)
- 新增 Agent 部署模块 (flnxi-agent/)
- 添加许可证验证和激活页面
- 添加 Harbor 镜像同步脚本
- 更新素材系统支持许可证验证
2025-12-15 21:19:46 +08:00

60 lines
1.9 KiB
JavaScript
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.

/** @type {import('next').NextConfig} */
const nextConfig = {
output: 'standalone',
productionBrowserSourceMaps: false,
compress: true,
swcMinify: true,
eslint: {
// 在生产构建时忽略ESLint错误
ignoreDuringBuilds: true,
},
typescript: {
// 在生产构建时忽略TypeScript错误(如果需要)
// ignoreBuildErrors: true,
},
// 解决 music-metadata-browser 的 Node.js polyfill 问题
webpack: (config, { isServer }) => {
if (!isServer) {
// 客户端构建时提供 Node.js 模块的 polyfill
config.resolve.fallback = {
...config.resolve.fallback,
fs: false,
path: false,
stream: require.resolve('stream-browserify'),
buffer: require.resolve('buffer/'),
string_decoder: require.resolve('string_decoder/'),
}
}
return config
},
images: {
remotePatterns: (() => {
const hosts = (process.env.IMAGE_REMOTE_HOSTS || '').split(',').map(s => s.trim()).filter(Boolean)
const defaults = ['s3.1080p.hk', '45.249.208.118', 'localhost'] // 添加服务器IP和localhost支持
const all = Array.from(new Set([...defaults, ...hosts]))
const patterns = []
for (const h of all) {
patterns.push({ protocol: 'https', hostname: h })
patterns.push({ protocol: 'http', hostname: h })
}
return patterns
})(),
},
experimental: {
serverActions: {
bodySizeLimit: '10gb', // Server Actions 的限制 (10GB)
},
instrumentationHook: true, // 启用 instrumentation.ts
},
// 允许构建时出现预渲染错误(这些页面会在运行时动态渲染)
onDemandEntries: {
maxInactiveAge: 25 * 1000,
pagesBufferLength: 2,
},
// 注意:CORS配置移到middleware.ts中处理,因为需要动态设置origin
// 当使用credentials时,不能使用通配符*
}
module.exports = nextConfig