-
Notifications
You must be signed in to change notification settings - Fork 7
/
next.config.js
48 lines (46 loc) · 1.4 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
/* eslint-disable @typescript-eslint/no-var-requires */
const { withPlaiceholder } = require("@plaiceholder/next");
const { createSecureHeaders } = require("next-secure-headers");
const config = {
reactStrictMode: true,
async headers() {
return [
{
source: "/:path*",
headers: [
...createSecureHeaders({
referrerPolicy: "strict-origin-when-cross-origin",
contentSecurityPolicy: {
directives: {
defaultSrc: [
"'self'",
"alexnault.dev",
"excalidraw.com",
"*.vercel-insights.com",
],
styleSrc: ["'self'", "'unsafe-inline'"],
scriptSrc: [
"'self'",
"'unsafe-inline'",
...(process.env.NODE_ENV === "development"
? ["'unsafe-eval'"] // For hot reload
: []),
],
imgSrc: ["'self'", "data:"],
baseUri: ["'self'"],
formAction: ["'self'"],
objectSrc: ["'none'"],
frameAncestors: true,
},
},
}),
{
key: "Permissions-Policy",
value: "camera=(), microphone=(), geolocation=()",
},
],
},
];
},
};
module.exports = withPlaiceholder(config);