-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
72 lines (68 loc) · 2.28 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
const webpack = require('webpack')
const WALLET_CONNECT_URLS = [
'https://*.walletconnect.com',
'https://*.walletconnect.org',
'wss://*.walletconnect.org',
].join(' ')
const ContentSecurityPolicy = `
default-src 'none';
script-src 'self' https://static.hotjar.com https://script.hotjar.com https://*.juicebox.money 'unsafe-inline' 'unsafe-eval';
style-src 'self' https://fonts.googleapis.com 'unsafe-inline';
font-src 'self' https://fonts.gstatic.com data:;
img-src 'self' https://*.juicebox.money https://juicebox.money https://*.infura-ipfs.io https://jbx.mypinata.cloud data:;
connect-src 'self' https://*.juicebox.money https://juicebox.money https://*.infura.io https://*.infura-ipfs.io https://jbx.mypinata.cloud https://api.studio.thegraph.com https://gateway.thegraph.com https://api.arcx.money https://api.tenderly.co https://*.hotjar.com https://*.hotjar.io wss://*.hotjar.com https://*.gnosis.io https://*.safe.global https://*.snapshot.org https://*.wallet.coinbase.com ${WALLET_CONNECT_URLS};
manifest-src 'self';
prefetch-src 'self';
frame-src 'self' https://vars.hotjar.com/ https://gnosis-safe.io https://app.safe.global;
`
module.exports = {
staticPageGenerationTimeout: 90,
webpack5: true,
webpack: config => {
config.resolve.fallback = { fs: false, module: false }
// Adds __DEV__ to the build to fix bug in apollo client `__DEV__ is not defined`.
config.plugins.push(
new webpack.DefinePlugin({
__DEV__: process.env.NODE_ENV !== 'production',
}),
)
return config
},
async redirects() {
return [
{
source: '/p',
destination: '/projects',
permanent: true,
},
{
source: '/v2/create',
destination: '/create',
permanent: true,
},
]
},
async rewrites() {
return [
{
source: '/@:projectId',
destination: '/v2/p/:projectId',
},
]
},
async headers() {
return [
{
// Apply these headers to all routes in your application.
source: '/:path*',
headers: [
{
key: 'Content-Security-Policy',
value: ContentSecurityPolicy.replace(/\s{2,}/g, ' ').trim(),
},
],
},
]
},
pageExtensions: ['page.tsx', 'page.ts', 'page.jsx', 'page.js'],
}