forked from irsyadadl/justd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.mjs
55 lines (53 loc) · 1.31 KB
/
next.config.mjs
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
55
import { createMDX } from "fumadocs-mdx/next"
const versionOneUrl = process.env.NEXT_PUBLIC_APP_V1_URL || "http://localhost:3000"
const withMDX = createMDX()
/** @type {import("next").NextConfig} */
const config = {
reactStrictMode: true,
devIndicators: {
buildActivity: false,
appIsrStatus: false,
},
experimental: {
reactCompiler: true,
},
async rewrites() {
return [
{
source: "/docs/1.x/:slug*",
destination: `${versionOneUrl}/docs/1.x/:slug*`,
},
]
},
async redirects() {
return [
{
source: "/docs/:slug((?![12]\\.x/).*)",
missing: [
{
type: "header",
key: "x-no-redirect",
},
],
destination: "/docs/2.x/:slug*",
permanent: false,
},
{
source: "/docs/2.x/components/layouts/aside",
destination: "/docs/2.x/components/layouts/sidebar",
permanent: true,
},
{
source: "/docs/2.x/components/surfaces/chart",
destination: "/docs/2.x/components/charts/setup",
permanent: true,
},
{
source: "/docs/2.x/components/collections/accordion",
destination: "/docs/2.x/components/navigation/disclosure-group",
permanent: true,
},
]
},
}
export default withMDX(config)