-
Notifications
You must be signed in to change notification settings - Fork 2
/
next.config.js
65 lines (60 loc) · 1.63 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
// next.config.js
const path = require('path')
const wikiLinkPlugin = require('remark-wiki-link')
const config = {
async redirects() {
return [
{
source: '/square',
destination:
'https://squareup.com/t/f_online/d_podcast/p_developertea/l_us/dt_alldevice/pr_developers/?route=us/en/developers',
permanent: true,
},
{
source: '/developer-tea',
destination: '/episodes',
permanent: true,
},
]
},
webpack: (config, { isServer }) => {
// Fixes npm packages that depend on `fs` module
//if (!isServer) {
//config.node = { fs: 'empty' }
//}
config.resolve.fallback = { fs: false }
return config
},
experimental: {
// This is experimental but can
// be enabled to allow parallel threads
// with nextjs automatic static generation
workerThreads: false,
cpus: 1,
},
async rewrites() {
return [
{
source: '/assets/:path*',
destination: '/api/assets/:path*',
},
]
},
pageExtensions: ['ts', 'tsx', 'js', 'jsx', 'md', 'mdx'],
}
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
})
const withMDX = require('@next/mdx')({
extension: /\.mdx?$/,
options: {
// If you use remark-gfm, you'll need to use next.config.mjs
// as the package is ESM only
// https://github.com/remarkjs/remark-gfm#install
remarkPlugins: [wikiLinkPlugin],
rehypePlugins: [],
// If you use `MDXProvider`, uncomment the following line.
roviderImportSource: '@mdx-js/react',
},
})
module.exports = withBundleAnalyzer(withMDX(config))