Files
mnote/wolai-frontend/next.config.ts
T
2026-01-11 12:35:53 +08:00

25 lines
760 B
TypeScript

import type { NextConfig } from "next";
const nextConfig: NextConfig = {
turbopack: {
// 避免 monorepo/多 lockfile 场景下 root 误判,减少构建与热更新的不确定性
root: __dirname,
},
async headers() {
// 说明:ONLYOFFICE 文档服务器会在其 iframe 内跨域拉取插件 manifest/js/html。
// 这里对插件资源放开 CORS,避免 pluginsData 加载失败。
return [
{
source: "/onlyoffice/plugins/:path*",
headers: [
{ key: "Access-Control-Allow-Origin", value: "*" },
{ key: "Access-Control-Allow-Methods", value: "GET,OPTIONS" },
{ key: "Access-Control-Allow-Headers", value: "*" },
],
},
];
},
};
export default nextConfig;