forked from hackclub/workshops
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.js
More file actions
48 lines (48 loc) 路 1.03 KB
/
Copy pathnext.config.js
File metadata and controls
48 lines (48 loc) 路 1.03 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
const isProd = process.env.NODE_ENV === 'production'
const withMDX = require('@next/mdx')({
extension: /\.mdx?$/,
options: {
providerImportSource: '@mdx-js/react'
}
})
module.exports = withMDX({
trailingSlash: true,
pageExtensions: ['js', 'jsx', 'mdx'],
assetPrefix: '/workshops',
images: {
imageSizes: [512]
},
webpack: (config, { isServer }) => {
if (!isServer) {
config.resolve.fallback = {
...config.resolve.fallback,
fs: false,
path: false
}
}
return config
},
async redirects() {
return [
{
source: '/privacy',
destination: '/privacy-and-terms',
permanent: true
}
]
},
async rewrites() {
return [
{
source: '/content/:slug*',
destination:
'https://raw.githubusercontent.com/hackclub/hackclub/main/:slug*'
},
{
source: '/workshops.json',
destination: '/api/workshops'
},
{ source: '/workshops/_next/:path*', destination: '/_next/:path*' }
]
}
})