1
+ import bundleAnalyzer from '@next/bundle-analyzer'
1
2
import nextra from 'nextra'
2
3
3
4
const withNextra = nextra ( {
@@ -20,66 +21,72 @@ export function getStaticProps() {
20
21
}
21
22
} )
22
23
24
+ const withBundleAnalyzer = bundleAnalyzer ( {
25
+ enabled : process . env . ANALYZE === 'true'
26
+ } )
27
+
23
28
/**
24
29
* @type {import('next').NextConfig }
25
30
*/
26
- export default withNextra ( {
27
- i18n : {
28
- locales : [ 'en' , 'es' , 'ru' ] ,
29
- defaultLocale : 'en'
30
- } , // basePath: "/some-base-path",
31
- distDir : './.next' , // Nextra supports custom `nextConfig.distDir`
32
- redirects : ( ) => [
33
- // {
34
- // source: "/docs.([a-zA-Z-]+)",
35
- // destination: "/docs/getting-started",
36
- // statusCode: 301,
37
- // },
38
- // {
39
- // source: "/advanced/performance",
40
- // destination: "/docs/advanced/performance",
41
- // statusCode: 301,
42
- // },
43
- // {
44
- // source: "/advanced/cache",
45
- // destination: "/docs/advanced/cache",
46
- // statusCode: 301,
47
- // },
48
- // {
49
- // source: "/docs/cache",
50
- // destination: "/docs/advanced/cache",
51
- // statusCode: 301,
52
- // },
53
- {
54
- source : '/change-log' ,
55
- destination : '/docs/change-log' ,
56
- statusCode : 301
57
- } ,
58
- {
59
- source : '/blog/swr-1' ,
60
- destination : '/blog/swr-v1' ,
61
- statusCode : 301
62
- } ,
63
- {
64
- source : '/docs.([a-zA-Z-]+)' ,
65
- destination : '/docs/getting-started' ,
66
- statusCode : 302
67
- } ,
68
- {
69
- source : '/docs' ,
70
- destination : '/docs/getting-started' ,
71
- statusCode : 302
72
- } ,
73
- {
74
- source : '/examples' ,
75
- destination : '/examples/basic' ,
76
- statusCode : 302
77
- } ,
78
- {
79
- source : '/' ,
80
- destination : '/en' ,
81
- permanent : true
82
- }
83
- ] ,
84
- reactStrictMode : true
85
- } )
31
+ export default withBundleAnalyzer (
32
+ withNextra ( {
33
+ i18n : {
34
+ locales : [ 'en' , 'es' , 'ru' ] ,
35
+ defaultLocale : 'en'
36
+ } , // basePath: "/some-base-path",
37
+ distDir : './.next' , // Nextra supports custom `nextConfig.distDir`
38
+ redirects : ( ) => [
39
+ // {
40
+ // source: "/docs.([a-zA-Z-]+)",
41
+ // destination: "/docs/getting-started",
42
+ // statusCode: 301,
43
+ // },
44
+ // {
45
+ // source: "/advanced/performance",
46
+ // destination: "/docs/advanced/performance",
47
+ // statusCode: 301,
48
+ // },
49
+ // {
50
+ // source: "/advanced/cache",
51
+ // destination: "/docs/advanced/cache",
52
+ // statusCode: 301,
53
+ // },
54
+ // {
55
+ // source: "/docs/cache",
56
+ // destination: "/docs/advanced/cache",
57
+ // statusCode: 301,
58
+ // },
59
+ {
60
+ source : '/change-log' ,
61
+ destination : '/docs/change-log' ,
62
+ statusCode : 301
63
+ } ,
64
+ {
65
+ source : '/blog/swr-1' ,
66
+ destination : '/blog/swr-v1' ,
67
+ statusCode : 301
68
+ } ,
69
+ {
70
+ source : '/docs.([a-zA-Z-]+)' ,
71
+ destination : '/docs/getting-started' ,
72
+ statusCode : 302
73
+ } ,
74
+ {
75
+ source : '/docs' ,
76
+ destination : '/docs/getting-started' ,
77
+ statusCode : 302
78
+ } ,
79
+ {
80
+ source : '/examples' ,
81
+ destination : '/examples/basic' ,
82
+ statusCode : 302
83
+ } ,
84
+ {
85
+ source : '/' ,
86
+ destination : '/en' ,
87
+ permanent : true
88
+ }
89
+ ] ,
90
+ reactStrictMode : true
91
+ } )
92
+ )
0 commit comments