docs: add script to catch bad redirects (#12361)

* docs: add script to catch bad redirects

* add missing dependency
This commit is contained in:
Shahed Nasser
2025-05-05 12:49:05 +03:00
committed by GitHub
parent e4d853185f
commit f25a4a5e34
9 changed files with 35 additions and 6 deletions

View File

@@ -7,6 +7,7 @@ import {
crossProjectLinksPlugin,
} from "remark-rehype-plugins"
import path from "path"
import { catchBadRedirects } from "build-scripts"
/** @type {import('next').NextConfig} */
const nextConfig = {
@@ -23,13 +24,13 @@ const nextConfig = {
optimizePackageImports: ["docs-utils"],
},
async redirects() {
return [
return catchBadRedirects([
{
source: "/api/download/:path",
destination: "/download/:path",
permanent: true,
},
]
])
},
}

View File

@@ -59,6 +59,7 @@
"@types/pluralize": "^0.0.33",
"@types/react": "npm:types-react@rc",
"@types/react-dom": "npm:types-react@rc",
"build-scripts": "*",
"eslint": "^9.13.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-react-hooks": "^5.0.0",