Files
lynkeduppro-crm/next.config.ts
T
tanweer919 a459fefb7f feat(landing): port the full marketing site into the CRM (static)
Copies the goutam-pages landing (React marketing home + /page/1..19 + assets)
into /public and adds beforeFiles rewrites so '/' serves the marketing home and
'/1'..'/19' + '/thanks' serve the static pages — reproducing the landing's
vercel.json clean URLs. /portal/* (login/register) is untouched.
2026-07-18 00:06:53 +05:30

36 lines
1.4 KiB
TypeScript

import type { NextConfig } from "next";
// The marketing landing is served as static files from /public (ported verbatim
// from lynkeduppro-landing). These rewrites reproduce the landing's vercel.json
// clean-URL routing: "/" is the React marketing home, "/1".."/19" are the static
// pages under /public/page. `beforeFiles` lets them override the app router's "/"
// (which otherwise redirects to /portal/login).
const landingRewrites: { source: string; destination: string }[] = [
{ source: "/", destination: "/index.html" },
{ source: "/thanks", destination: "/thanks.html" },
{ source: "/1", destination: "/page/index.html" },
// "/2".."/19" -> /public/page/<n>.html
...Array.from({ length: 18 }, (_, i) => i + 2).map((n) => ({
source: `/${n}`,
destination: `/page/${n}.html`,
})),
];
const nextConfig: NextConfig = {
// The SDK ships ESM/TS; let Next transpile it.
transpilePackages: ["@abe-kap/appshell-sdk"],
async rewrites() {
// The browser calls the Shell BFF same-origin under /shell (so the HttpOnly
// session cookie flows). We deliberately use /shell (NOT /api) to avoid
// clobbering the /api/* route handlers (geo, and the founder checkout).
const bff = process.env.BFF_ORIGIN ?? "http://localhost:4000";
return {
beforeFiles: landingRewrites,
afterFiles: [{ source: "/shell/:path*", destination: `${bff}/api/:path*` }],
fallback: [],
};
},
};
export default nextConfig;