Skip to content

Commit 0b1688e

Browse files
committed
Remove code for redirects in vercel.json
1 parent c5a0729 commit 0b1688e

File tree

1 file changed

+0
-34
lines changed

1 file changed

+0
-34
lines changed

website/prep.js

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,6 @@
33
* @import {Root} from 'hast'
44
*/
55

6-
/**
7-
* @typedef Redirect
8-
* Redirect.
9-
* @property {string} destination
10-
* To.
11-
* @property {string} source
12-
* From.
13-
*/
14-
156
import fs from 'node:fs/promises'
167
import {fileURLToPath} from 'node:url'
178
import {globby} from 'globby'
@@ -75,31 +66,6 @@ await pAll(
7566

7667
console.log('✔ %d redirects', Object.keys(redirect).length)
7768

78-
// To do: drop Vercel.
79-
/** @type {Array<Readonly<Redirect>>} */
80-
const vercelRedirects = []
81-
/** @type {string} */
82-
let redirectFrom
83-
84-
for (redirectFrom in redirect) {
85-
if (Object.hasOwn(redirect, redirectFrom)) {
86-
const source = redirectFrom.replace(/\/index.html$/, '/')
87-
const destination = redirect[redirectFrom]
88-
vercelRedirects.push({destination, source})
89-
}
90-
}
91-
92-
// To do: drop Vercel.
93-
/** @type {Record<string, unknown> & {redirects: ReadonlyArray<Readonly<Redirect>>}} */
94-
const vercelInfo = JSON.parse(String(await fs.readFile('vercel.json')))
95-
await fs.writeFile(
96-
'vercel.json',
97-
JSON.stringify({...vercelInfo, redirects: vercelRedirects}, undefined, 2) +
98-
'\n'
99-
)
100-
101-
console.log('✔ `vercel.json` redirects')
102-
10369
/**
10470
*
10571
* @param {string} to

0 commit comments

Comments
 (0)