-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
next.config.js
86 lines (82 loc) · 2.36 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/* eslint-disable @typescript-eslint/no-var-requires */
const nextSafe = require("next-safe");
const withPlugins = require("next-compose-plugins");
const withBundleAnalyzer = require("@next/bundle-analyzer")({
enabled: process.env.ANALYZE === "true",
});
// NextPWA Config
// const withPWA = require("next-pwa")({
// dest: "public",
// register: true,
// scope: "/",
// sw: "sw.js",
// buildExcludes: [/\.next/, /node_modules/],
// cacheStartUrl: false,
// dynamicStartUrl: false,
// reloadOnOnline: true,
// disable: true,
// });
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
images: {
unoptimized: true,
remotePatterns: [
{
protocol: "https",
hostname: "api.netlify.com",
},
{
protocol: "https",
hostname: "api.um.ac.id",
},
{
protocol: "https",
hostname: "is3.cloudhost.id",
},
{
protocol: "https",
hostname: "**.google.com",
},
],
},
async headers() {
return [
{
source: "/:path*",
headers: nextSafe({
isDev: false,
contentSecurityPolicy: {
"base-uri": "'none'",
"child-src": "'none'",
"connect-src": "'self' webpack://* https: data:",
"default-src": "'self'",
"font-src": "'self'",
"form-action": "'self'",
"frame-ancestors": "'none'",
"frame-src":
"'none' https://www.youtube.com/ https://docs.google.com/",
"img-src":
"'self' https://is3.cloudhost.id/teknologipendidikan/objectstorage-pamerankarya/ https://drive.google.com https://*.googleusercontent.com",
"manifest-src": "'self'",
"media-src": "'self'",
"object-src": "'none'",
"prefetch-src": "'self'",
"script-src":
"'self' 'unsafe-eval' 'unsafe-inline' https://www.youtube.com/ https://www.googletagmanager.com/gtag/js https://netlify-rum.netlify.app/ 'sha256-wzRmNN3+4L3v3ZHovwiO9F+QFCmvsqZ8zZ05lCRcmOY='",
"style-src": "'self' 'unsafe-inline'",
"worker-src": "'self' blob:",
"report-uri": "https://dptsi.edtech.or.id",
},
}),
},
];
},
};
module.exports = withPlugins(
[
// [withPWA],
[withBundleAnalyzer],
],
nextConfig,
);