-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnext.config.js
41 lines (39 loc) · 1003 Bytes
/
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
const { isDev } = require("./config");
const { DEVICE_SIZES, IMAGE_SIZES } = require("./constants/images");
const ContentSecurityPolicy = `
default-src 'none';
base-uri 'self';
connect-src 'self' ${
// Local development websocket wildcard for Safari: https://github.com/graphile/starter/pull/244
isDev ? "*" : ""
};
script-src 'self' 'unsafe-eval' www.youtube.com;
style-src 'self' 'unsafe-inline';
font-src 'self';
img-src 'self' data:;
frame-src www.youtube.com;
`;
/** @type {import('next').NextConfig} */
module.exports = {
reactStrictMode: true,
productionBrowserSourceMaps: true,
optimizeFonts: false,
images: {
loader: "custom",
deviceSizes: DEVICE_SIZES,
imageSizes: IMAGE_SIZES,
},
async headers() {
return [
{
source: "/(.*)",
headers: [
{
key: "Content-Security-Policy",
value: ContentSecurityPolicy.replace(/\s{2,}/g, " ").trim(),
},
],
},
];
},
};