-
-
Notifications
You must be signed in to change notification settings - Fork 395
Expand file tree
/
Copy path+redirects.ts
More file actions
54 lines (51 loc) · 1.95 KB
/
Copy path+redirects.ts
File metadata and controls
54 lines (51 loc) · 1.95 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
52
53
54
export { redirects }
import type { Config } from 'vike/types'
import type { HeadingsURL } from './headings'
import { checkType } from './utils/checkType'
// Use TypeScript to check whether redirect targets point to an existing page
type RemoveHash<T extends string> = T extends `${infer Path}#${string}` ? Path : T
type RedirectsURL = RemoveHash<(typeof redirects)[keyof typeof redirects]>
checkType<HeadingsURL>(0 as any as RedirectsURL)
const redirects = {
'/netlify-functions': '/netlify',
'/deploy': '/self-host',
'/aws-lambda': '/aws',
'/common-problems': '/common-issues',
'/data-tools': '/data-fetching#page-data-with-tools',
'/https': '/server#https',
'/css-tools': '/css-in-js',
'/errors': '/error-tracking',
'/SPA-vs-SSR-vs-HTML': '/render-modes',
'/Head-setting': '/head-tags',
'/head': '/head-tags',
'/CSP': '/csp',
'/clientOnly': '/ClientOnly',
'/add-ssr-to-vite-app': '/add',
'/scaffold': '/new',
'/prerender-config': '/prerender',
'/pageContext-anywhere': '/pageContext',
'/client-only-components': '/ClientOnly',
'/vike-packages': '/extensions',
'/page-redirection': '/redirect',
'/header-file': '/config#pointer-imports',
'/header-file/import-from-same-file': '/config#pointer-imports',
'/vue-router-and-react-router': '/react-router',
'/react-query': '/tanstack-query',
'/useClientRouter': '/clientRouting',
'/html-streaming': '/streaming',
'/preload': '/preloading',
'/layouts': '/Layout',
'/nextauth': '/Auth.js',
'/NextAuth.js': '/Auth.js',
'/html-head': '/head-tags',
'/SR-vs-CR': '/server-routing-vs-client-routing',
'/render-as-you-fetch': '/streaming',
'/v1-design': '/migration/v1-design',
'/config-code-splitting': '/config#pointer-imports',
'/dynamic-import': '/clientOnly-helper',
'/.env-files': '/env',
'/cloudflare-workers': '/cloudflare',
'/migration-0.4': '/migration/0.4',
'/catch-all': '/route-string#catch-all',
'/gift': '/free',
} as const satisfies Config['redirects']