forked from OpenBeta/open-tacos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
72 lines (69 loc) · 1.75 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
66
67
68
69
70
71
72
module.exports = {
images: {
loader: 'custom',
loaderFile: './src/image-loader.js'
},
typescript: {
ignoreBuildErrors: false
},
webpack (config, { isServer }) { // required by @svgr/webpack lib
const fileLoaderRule = config.module.rules.find((rule) => rule.test?.test?.('.svg'))
config.externals = [...config.externals, isServer ? { canvas: 'canvas', jsdom: 'jsdom', paper: 'paper' } : {}]
config.module.rules.push({
test: /\.svg$/i,
issuer: fileLoaderRule.issuer,
// issuer: /\.[jt]sx?$/,
use: ['@svgr/webpack']
})
fileLoaderRule.exclude = /\.svg$/i
return config
},
async rewrites () {
return [
{ // A hack to pass ?gallery=true to getStaticProps()
source: '/u/:uid/:postid',
has: [
{
type: 'query',
key: 'gallery',
value: 'true'
}],
destination: '/u/:uid/:postid/gallery'
}
]
},
async redirects () {
return [
{
source: '/map',
destination: '/maps',
permanent: true
},
{
source: '/areas/:uuid',
destination: '/area/:uuid/',
permanent: true
},
{
source: '/crag/:uuid',
destination: '/area/:uuid/',
permanent: true
},
{
source: '/blog',
destination: 'https://openbeta.substack.com/',
permanent: false
},
{
source: '/blog/openbeta-vs-mountain-project-vs-thecrag',
destination: 'https://openbeta.substack.com/p/openbeta-vs-mountainproject-vs-thecrag',
permanent: false
},
{
source: '/partner-with-us',
destination: '/Become-OpenBeta-Partner-in-Climb-dec-2023.pdf',
permanent: false
}
]
}
}