forked from polkassembly/polkassembly
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnext.config.js
70 lines (68 loc) · 1.72 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
// Copyright 2019-2025 @polkassembly/polkassembly authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
/* eslint-disable indent */
/* eslint-disable sort-keys */
/** @type {import('next').NextConfig} */
const nextConfig = {
async headers() {
return [
{
// matching all v1 API routes
source: '/api/:path*',
headers: [
{ key: 'Access-Control-Allow-Credentials', value: 'true' },
{ key: 'Access-Control-Allow-Origin', value: '*' },
{ key: 'Access-Control-Allow-Methods', value: 'GET,OPTIONS,PATCH,DELETE,POST,PUT' },
{ key: 'Access-Control-Allow-Headers', value: '*' },
{ key: 'X-Frame-Options', value: 'SAMEORIGIN' },
{ key: 'Content-Security-Policy', value: "default-src 'self'; img-src '*'" },
{ key: 'Cache-Control', value: 's-maxage=60, stale-while-revalidate=59' }
]
}
];
},
async rewrites() {
return {
fallback: [
// These rewrites are checked after both pages/public files
// and dynamic routes are checked
{
source: '/:path*',
destination: 'http://kusama-old.polkassembly.io/:path*',
has: [
{
type: 'host',
value: 'kusama.polkassembly.io'
}
]
},
{
source: '/:path*',
destination: 'http://polkadot-old.polkassembly.io/:path*',
has: [
{
type: 'host',
value: 'polkadot.polkassembly.io'
}
]
}
]
};
},
images: {
domains: ['parachains.info']
},
reactStrictMode: true,
compiler: {
styledComponents: true
},
webpack(config) {
config.module.rules.push({
test: /\.svg$/,
use: ['@svgr/webpack']
});
return config;
}
};
module.exports = nextConfig;