Files
forumlify/next.config.js
T
lezi-fun d304e7e863 fix: remove OpenNext dev hook from next.config (spawns workerd in build)
initOpenNextCloudflareForDev() runs when next.config.js loads → spawns
workerd binary (missing in Docker/node:20-alpine) → build crashes with
ENOENT. The hook is only for opennextjs-cloudflare preview (dev);
production build/deploy doesn't need it.
2026-08-11 18:00:03 +08:00

16 lines
591 B
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 = {
// 本地开发同时支持 localhost 和 127.0.0.1,避免客户端脚本被跨源保护拦截。
allowedDevOrigins: ['127.0.0.1'],
// Docker 部署用 standalone 输出;serverless(Vercel/CF Pages)不需要
...(process.env.DOCKER ? { output: 'standalone' } : {}),
// /uploads/* 由 API 路由提供(上传文件运行时新增,不进 public 构建快照)
async rewrites() {
return [
{ source: '/uploads/:name', destination: '/api/uploads/:name' },
];
},
};
module.exports = nextConfig;