2026-01-04 21:58:59 -05:00
|
|
|
/** @type {import('next').NextConfig} */
|
|
|
|
|
const nextConfig = {
|
|
|
|
|
output: "standalone",
|
2026-03-18 09:25:48 -04:00
|
|
|
serverExternalPackages: ["better-sqlite3"],
|
2026-02-01 21:37:30 -05:00
|
|
|
images: {
|
|
|
|
|
unoptimized: true
|
|
|
|
|
},
|
2026-02-24 23:40:50 -05:00
|
|
|
env: {},
|
2026-01-04 21:58:59 -05:00
|
|
|
webpack: (config, { isServer }) => {
|
|
|
|
|
// Ignore fs/path modules in browser bundle
|
|
|
|
|
if (!isServer) {
|
|
|
|
|
config.resolve.fallback = {
|
|
|
|
|
...config.resolve.fallback,
|
|
|
|
|
fs: false,
|
|
|
|
|
path: false,
|
|
|
|
|
};
|
|
|
|
|
}
|
2026-02-21 02:36:06 -05:00
|
|
|
// Stop watching logs directory to prevent HMR during streaming
|
|
|
|
|
config.watchOptions = { ...config.watchOptions, ignored: /[\\/](logs|\.next)[\\/]/ };
|
2026-01-04 21:58:59 -05:00
|
|
|
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;
|