-
Notifications
You must be signed in to change notification settings - Fork 333
/
next.config.js
72 lines (61 loc) · 1.43 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
const withMDX = require('@next/mdx')({
extension: /\.(md|mdx)?$/,
options: {
rehypePlugins: [require('@mapbox/rehype-prism'), require('rehype-join-line')],
},
})
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
})
const nextConfig = {
generateEtags: false,
poweredByHeader: false,
eslint: {
ignoreDuringBuilds: true,
},
pageExtensions: ['jsx', 'js', 'mdx', 'md', 'ts', 'tsx'],
cssModules: true,
cssLoaderOptions: {
importLoaders: 1,
localIdentName: '[local]___[hash:base64:5]',
},
env: {
VERSION: require('./package.json').version,
},
trailingSlash: false,
async redirects() {
return [
{
source: '/',
permanent: true,
destination: '/en-us',
},
{
source: '/icons',
permanent: true,
destination: '/en-us/components/icons',
},
{
source: '/en-us/customization',
destination: '/en-us',
permanent: true,
},
{
source: '/zh-cn/customization',
destination: '/zh-cn',
permanent: true,
},
{
source: '/en-us/guide/scaleable',
destination: '/en-us/guide/scale',
permanent: true,
},
{
source: '/zh-cn/guide/scaleable',
destination: '/zh-cn/guide/scale',
permanent: true,
},
]
},
}
module.exports = withBundleAnalyzer(withMDX(nextConfig))