9router/next.config.mjs
decolua 8f4d29caa4 # v0.4.30 (2026-05-11)
## Features
- MCP stdio→SSE bridge: expose local stdio MCP plugins over SSE (api/mcp/[plugin]/sse, /message)
- Dynamic Linux cert resolution + NSS DB injection (Debian/Arch/Fedora/openSUSE, Chrome/Chromium/Firefox incl. snap) (#1010)
- Cowork tool: expanded settings UI & API
- GitBook docs (DocsContent, DocsLayout)
## Fixes
- OAuth callback postMessage scoped to expected origins (CWE-1385) (#998)
- Re-enable TLS verification on DNS-bypass fetch (CWE-295) (#998)
- Normalize `developer` role → `system` for OpenAI-format providers (Deepseek, Groq, …) (#1011, closes #773)
- Respect `PORT` env in internal model-test fetch (#1014)
- Dropdown text readability in dark theme on usage page (#997)
## Improvements
- Refactor Claude CLI spoof headers into shared constant
- Tool deduper utility in open-sse handlers
2026-05-12 09:19:50 +07:00

61 lines
1.4 KiB
JavaScript

import { fileURLToPath } from "node:url";
import { dirname, resolve } from "node:path";
const projectRoot = dirname(fileURLToPath(import.meta.url));
const monorepoRoot = resolve(projectRoot, "..");
/** @type {import('next').NextConfig} */
const nextConfig = {
output: "standalone",
serverExternalPackages: ["better-sqlite3", "sql.js", "node:sqlite", "bun:sqlite"],
turbopack: {
root: projectRoot
},
outputFileTracingRoot: monorepoRoot,
outputFileTracingExcludes: {
"*": ["./app/gitbook/**/*", "./gitbook/**/*"]
},
images: {
unoptimized: true
},
env: {},
webpack: (config, { isServer }) => {
// Ignore fs/path modules in browser bundle
if (!isServer) {
config.resolve.fallback = {
...config.resolve.fallback,
fs: false,
path: false,
};
}
// Exclude logs, .next, gitbook subapp from watcher
config.watchOptions = { ...config.watchOptions, ignored: /[\\/](logs|\.next|gitbook)[\\/]/ };
return config;
},
async rewrites() {
return [
{
source: "/v1/v1/:path*",
destination: "/api/v1/:path*"
},
{
source: "/v1/v1",
destination: "/api/v1"
},
{
source: "/codex/:path*",
destination: "/api/v1/responses"
},
{
source: "/v1/:path*",
destination: "/api/v1/:path*"
},
{
source: "/v1",
destination: "/api/v1"
}
];
}
};
export default nextConfig;