-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
51 lines (46 loc) · 1.42 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
const withMDX = require('@next/mdx')({
options: {
remarkPlugins: [],
rehypePlugins: [],
},
})
module.exports = withMDX({
pageExtensions: ['js', 'jsx', 'mdx'],
poweredByHeader: false,
crossOrigin: 'use-credentials',
images: {
domains: ['brand-assets.sitesauce.app', 'images.sitesauce.app', 'miguelpiedrafita.com'],
},
future: {
webpack5: true,
},
rewrites: () => [
{ source: '/blog/feed.xml', destination: '/_next/static/posts.xml' },
{ source: '/guides/feed.xml', destination: '/_next/static/guides.xml' },
{ source: '/analytics', destination: 'https://app.usefathom.com/share/atrfrddr/sitesauce.app' },
{ source: '/sites/1025/:path*', destination: 'https://app.usefathom.com/sites/1025/:path*' },
],
redirects: () => [{ source: '/status', destination: 'https://sitesauce.instatus.com/', permanent: true }],
webpack: (config, { dev, isServer }) => {
if (!dev && isServer) {
const originalEntry = config.entry
config.entry = async () => {
const entries = { ...(await originalEntry()) }
entries['./scripts/build-rss.js'] = './scripts/build-rss.js'
return entries
}
}
if (!dev && !isServer) {
Object.assign(config.resolve.alias, {
react: 'preact/compat',
'react-dom': 'preact/compat',
})
}
return config
},
exportPathMap(defaultPathMap, { dev, outDir }) {
if (dev) return
const generateRSS = require('./.next/server/scripts/build-rss.js').default
generateRSS(outDir)
},
})