forked from geist-org/geist-ui
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathnext.config.js
77 lines (69 loc) · 1.62 KB
/
next.config.js
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
const path = require('path')
const withMDX = require('@next/mdx')({
extension: /\.(md|mdx)?$/,
options: {
rehypePlugins: [require('@mapbox/rehype-prism')],
},
})
const nextConfig = {
webpack: (config, options) => {
config.module.rules.push({
test: /\.playground/,
use: ({ issuer }) => {
return [
{
loader: path.resolve(
__dirname,
'loaders',
`playground-loader-${(issuer && issuer.indexOf('zh-cn')) > -1 ? 'zh' : 'en'}.js`,
),
},
]
},
})
return config
},
target: 'serverless',
pageExtensions: ['jsx', 'js', 'mdx', 'md', 'ts', 'tsx'],
cssModules: true,
cssLoaderOptions: {
importLoaders: 1,
localIdentName: '[local]___[hash:base64:5]',
},
env: {
VERSION: require('./package.json').version,
},
experimental: {
reactStrictMode: true,
redirects() {
return [
{
source: '/docs/getting-started/:path*',
permanent: true,
destination: '/en-us/guide/:path*',
},
{
source: '/en-us/getting-started/:path*',
permanent: true,
destination: '/en-us/guide/:path*',
},
{
source: '/zh-cn/getting-started/:path*',
permanent: true,
destination: '/zh-cn/guide/:path*',
},
{
source: '/zh-cn/',
permanent: true,
destination: '/zh-cn',
},
{
source: '/en-us/',
permanent: true,
destination: '/en-us',
},
]
},
},
}
module.exports = withMDX(nextConfig)