9router/next.config.mjs
decolua 7ccf8c5e84 # v0.4.36 (2026-05-13)
## Features
- Add MiniMax TTS provider support (#1043)
- Docker images now published on both GHCR & Docker Hub (decolua/9router) — pull from your preferred registry

## Improvements
- Replace browser confirm dialogs with custom ConfirmModal (#1060)

## Fixes
- Fix Docker `Cannot find module 'next'` error in standalone build
- Restore /app/server.js in Docker standalone build (#1064, #1067)
- Fix CLI TUI menu arrow-key escape sequences leaking (^[[A^[[B)
- Switch macOS/Linux tray to systray2 fork (fixes Kaspersky AV false-positive) (#1080)
- Fix zoom controls contrast in topology view (#1066)
2026-05-13 18:22:31 +07:00

63 lines
1.6 KiB
JavaScript

import { fileURLToPath } from "node:url";
import { dirname, join } from "node:path";
const projectRoot = dirname(fileURLToPath(import.meta.url));
// Workspace root (one level up from app/) — where npm hoists deps.
// Next.js tracing must scan from here to find "next", "react", etc.
const workspaceRoot = join(projectRoot, "..");
/** @type {import('next').NextConfig} */
const nextConfig = {
output: "standalone",
serverExternalPackages: ["better-sqlite3", "sql.js", "node:sqlite", "bun:sqlite"],
turbopack: {
root: workspaceRoot
},
outputFileTracingRoot: workspaceRoot,
outputFileTracingExcludes: {
"*": ["./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|cli)[\\/]/ };
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;