-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnext.config.js
54 lines (52 loc) · 1.05 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
const path = require('path')
const { i18n } = require('./next-i18next.config')
const { BLOG_URL, DOCS_URL, DOCS_SHORT_URL } = process.env
const securityHeaders = [
{
key: 'X-Frame-Options',
value: 'deny'
},
]
module.exports = {
reactStrictMode: true,
sassOptions: {
includePaths: [path.join(__dirname, 'styles')],
},
i18n,
images: {
formats: ["image/avif", "image/webp"],
},
async headers() {
return [
{
// Apply these headers to all routes in your application.
source: '/(.*)',
headers: securityHeaders,
},
]
},
async rewrites() {
return [
{
source: '/:path*',
destination: `/:path*`,
},
{
source: '/blog',
destination: `${BLOG_URL}/blog`,
},
{
source: '/blog/:path*',
destination: `${BLOG_URL}/blog/:path*`,
},
{
source: '/docs',
destination: `${DOCS_URL}`,
},
{
source: '/docs/:path*',
destination: `${DOCS_SHORT_URL}/:path*`,
}
]
},
}