wealth/apps/bull/next.config.ts

38 lines
1.1 KiB
TypeScript

import { withIslandAssets } from '@lumina/island/tools/asset-plugin';
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,
},
];
},
};
// On next dev and next build, writes island's hashed fonts and icon sprite into public/ (0008).
export default withIslandAssets(nextConfig);