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>
44 lines
930 B
TypeScript
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;
|