36 lines
946 B
TypeScript
36 lines
946 B
TypeScript
import type { NextConfig } from 'next';
|
|
|
|
const nextConfig: NextConfig = {
|
|
// Workspace packages export TypeScript source, so Next.js compiles them.
|
|
transpilePackages: [
|
|
'@lumina/market',
|
|
'@lumina/integrations',
|
|
'@lumina/island',
|
|
'@lumina/libs',
|
|
'@lumina/tools',
|
|
],
|
|
// `/@{username}` is the public channel URL. A folder named `@…` is a
|
|
// parallel-route slot in the App Router, so the routes live under
|
|
// `channels/[username]` and the public URL is rewritten onto them.
|
|
async rewrites() {
|
|
return [
|
|
{
|
|
source: '/@:username/:path*',
|
|
destination: '/channels/:username/:path*',
|
|
},
|
|
];
|
|
},
|
|
// One canonical URL per channel: send direct `/channels/…` hits to `/@…`.
|
|
async redirects() {
|
|
return [
|
|
{
|
|
source: '/channels/:username/:path*',
|
|
destination: '/@:username/:path*',
|
|
permanent: true,
|
|
},
|
|
];
|
|
},
|
|
};
|
|
|
|
export default nextConfig;
|