nomadro/next.config.ts
eric 9928c5185b Mount nav/book/community as native App Router routes in one Next process.
Replace reverse-proxy/iframe approach with @ebook/@community/@navmini imports under /nav /book /community so localhost:3000 serves all three products directly.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-28 03:49:16 -05:00

44 lines
930 B
TypeScript

import path from "node:path";
import type { NextConfig } from "next";
const API_URL = (process.env.API_URL || "http://127.0.0.1:8000").replace(
/\/$/,
"",
);
const aliases = {
"@ebook": path.resolve(__dirname, "apps/ebook/src"),
"@community": path.resolve(__dirname, "apps/nomadweb/frontend/src"),
"@navmini": path.resolve(__dirname, "apps/navmini/src"),
};
const nextConfig: NextConfig = {
experimental: {
externalDir: true,
},
turbopack: {
resolveAlias: {
"@ebook": "./apps/ebook/src",
"@community": "./apps/nomadweb/frontend/src",
"@navmini": "./apps/navmini/src",
},
},
webpack: (config) => {
config.resolve.alias = {
...config.resolve.alias,
...aliases,
};
return config;
},
async rewrites() {
return [
{
source: "/api/:path*",
destination: `${API_URL}/api/:path*`,
},
];
},
};
export default nextConfig;