forked from wevm/wagmi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.mjs
80 lines (77 loc) · 2.08 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
import nextra from 'nextra'
import withPreconstruct from '@preconstruct/next'
const withNextra = nextra({
defaultShowCopyCode: true,
flexsearch: {
codeblocks: false,
},
theme: 'nextra-theme-docs',
themeConfig: './theme.config.tsx',
staticImage: true,
})
/** @type {import('next').NextConfig} */
const config = {
i18n: {
locales: ['en-US','zh-CN'],
defaultLocale: 'en-US',
},
reactStrictMode: true,
redirects() {
return [
// Redirects for old docs
{
source: '/docs/create-wagmi',
destination: '/cli/create-wagmi',
permanent: true,
},
{
source: '/docs/:path*',
destination: '/react/:path*',
permanent: true,
},
{
source: '/guides/:path*',
destination: '/examples/:path*',
permanent: true,
},
// Redirect paths to first page in section
{
source: '/react',
destination: '/react/getting-started',
permanent: true,
},
{
source: '/core',
destination: '/core/getting-started',
permanent: true,
},
{
source: '/cli',
destination: '/cli/getting-started',
permanent: true,
},
{
source: '/examples',
destination: '/examples/connect-wallet',
statusCode: 302,
},
// External redirects
{
source: '/gitcoin',
destination:
'https://grant-explorer.gitcoin.co/#/round/1/0xe575282b376e3c9886779a841a2510f1dd8c2ce4/0x50f3dbb23d121a397941e827ce2f10a0aea7f5cf311de6e3abcfe3847c56c405-0xe575282b376e3c9886779a841a2510f1dd8c2ce4',
permanent: false,
},
]
},
typescript: {
// Disable type checking since eslint handles this
ignoreBuildErrors: true,
},
}
// We don't use Preconstruct anymore, but the Next.js plugin works great for
// development with our custom set up in packages' `tsup.config.ts`.
// https://github.com/preconstruct/preconstruct/tree/main/packages/next
export default process.env.NODE_ENV === 'development'
? withPreconstruct(withNextra(config))
: withNextra(config)