forked from wei/socialify
-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
49 lines (44 loc) · 1.01 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 GoogleFontsPlugin = require('google-fonts-plugin')
const fontNames = require('./common/fonts/fonts.json')
module.exports = {
target: 'experimental-serverless-trace',
webpack: (config) => {
config.plugins.push(
new GoogleFontsPlugin({
fonts: Object.values(fontNames).map((f) => ({
family: f,
variants: ['200', '400', '500']
})),
filename: 'google-fonts.css',
formats: ['woff2']
})
)
return config
},
async rewrites() {
return [
{
source: '/:_owner/:_name/svg',
destination: '/api/svg'
},
{
source: '/:_owner/:_name/image',
destination: '/api/svg'
},
// Kept for legacy support
{
source: '/:_owner/:_name/png',
destination: '/api/svg'
},
// Kept for legacy support
{
source: '/:_owner/:_name/jpg',
destination: '/api/svg'
},
{
source: '/graphql',
destination: '/api/graphql'
}
]
}
}