-
Notifications
You must be signed in to change notification settings - Fork 509
Expand file tree
/
Copy pathnext.config.mjs
More file actions
61 lines (57 loc) · 1.56 KB
/
Copy pathnext.config.mjs
File metadata and controls
61 lines (57 loc) · 1.56 KB
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
import bundleAnalyzer from '@next/bundle-analyzer'
import nextra from 'nextra'
// TODO
// import { compose } from 'midash'
// ({
// enabled: process.env.ANALYZE === 'true'
// })
const config = {
output: 'standalone',
env: {
gaId: 'UA-',
OPENAI_API_BASEURL: 'api.nextapi.fun'
},
webpack(config) {
return config
},
async redirects() {
return [
{
source: '/engineering/:number.html',
destination: '/engineering/e:number', // Matched parameters can be used in the destination
permanent: true,
statusCode: 301
},
{
source: '/fe/%E5%89%8D%E7%AB%AF%E5%B7%A5%E7%A8%8B%E5%8C%96/:slug*',
destination: '/fe/engineering/:slug*', // Matched parameters can be used in the destination
permanent: true,
statusCode: 301
},
{
source: '/server/%E7%88%AC%E8%99%AB/:slug*',
destination: '/server/crawler/:slug*', // Matched parameters can be used in the destination
permanent: true,
statusCode: 301
},
{
source: '/:slug*.html',
destination: '/:slug*', // Matched parameters can be used in the destination
permanent: true,
statusCode: 301
},
{
source: '/base/http/:slug',
destination: '/fe/http/:slug', // Matched parameters can be used in the destination
permanent: true,
statusCode: 301
}
]
},
}
export default bundleAnalyzer({
enabled: process.env.ANALYZE === 'true'
})(nextra({
theme: 'nextra-theme-docs',
themeConfig: './theme.config.tsx',
})(config))