-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
next.config.js
49 lines (44 loc) · 1.2 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
const path = require('path')
// To run bundle analyzer, set the `ANALYZE` environment variable to 'true'.
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true'
})
/** @type {import('next').NextConfig} */
module.exports = withBundleAnalyzer({
reactStrictMode: true,
// These take effect in development and should match the redirects in netlify.toml
async redirects() {
return [
{
source: '/',
destination: '/docs/introduction',
permanent: true
},
{
source: '/docs',
destination: '/docs/introduction',
permanent: true
},
{
source: '/community',
destination: '/docs/community',
permanent: true
}
]
},
webpack: config => {
return {
...config,
resolve: {
...config.resolve,
alias: {
...config.resolve.alias,
// See site/module-stubs/README.md
cosmiconfig: path.resolve(__dirname, 'module-stubs/cosmiconfig.cjs'),
'find-root': path.resolve(__dirname, 'module-stubs/find-root.cjs'),
resolve: path.resolve(__dirname, 'module-stubs/resolve.cjs')
}
}
}
}
})