-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathnext.config.mjs
More file actions
51 lines (46 loc) · 2.18 KB
/
Copy pathnext.config.mjs
File metadata and controls
51 lines (46 loc) · 2.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import { TARGET } from './deploy.config.mjs';
const dir = path.dirname(fileURLToPath(import.meta.url));
/** @type {import('next').NextConfig} */
const nextConfig = {
// Keep tracing rooted at this checkout so a git worktree inside the repo
// is not mistaken for a nested package of the parent lockfile.
outputFileTracingRoot: dir,
// Emit a self-contained server bundle (.next/standalone/server.js) so the
// internal Docker image can run the app without node_modules. Vercel
// ignores this and uses its own runtime, so it's a no-op there.
output: 'standalone',
// Demos live under /vibenet/demos. They briefly sat at the top-level /demos,
// whose paths were published in the sitemap and linked externally, so those
// old paths are permanently redirected rather than left to 404 for existing
// links and search results.
//
// Internal Explorer moved from /tips to /internal-explorer. Legacy redirects
// are internal-only: the public build 404s both prefixes via middleware so
// it never advertises the internal surface.
async redirects() {
return [
// The old demos index merged into the Vibenet overview; deep demo links
// map straight to their new home under /vibenet/demos.
{ source: '/demos', destination: '/vibenet', permanent: true },
{ source: '/demos/:path*', destination: '/vibenet/demos/:path*', permanent: true },
// /vibenet/demos has no index page — the demo list lives on the Vibenet
// overview, so send the bare path there.
{ source: '/vibenet/demos', destination: '/vibenet', permanent: true },
...(TARGET === 'internal'
? [
{ source: '/tips', destination: '/internal-explorer', permanent: true },
{ source: '/tips/:path*', destination: '/internal-explorer/:path*', permanent: true },
{ source: '/api/tips', destination: '/api/internal-explorer', permanent: true },
{
source: '/api/tips/:path*',
destination: '/api/internal-explorer/:path*',
permanent: true,
},
]
: []),
];
},
};
export default nextConfig;