-
Notifications
You must be signed in to change notification settings - Fork 1
/
next.config.js
83 lines (82 loc) · 2.56 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
const { i18n } = require('./next-i18next.config')
const CompressionPlugin = require('compression-webpack-plugin');
const ImageMinimizerPlugin = require("image-minimizer-webpack-plugin");
module.exports = {
i18n,
images: {
domains: ['images.prismic.io', 'source.unsplash.com'],
},
eslint: {
ignoreDuringBuilds: true,
},
experimental: {
esmExternals: false,
},
async headers() {
return [
{
source: '/:path*',
headers: [
{
key: 'Strict-Transport-Security',
value:
'max-age=63072000; includeSubDomains; preload',
},
{
key: 'X-Frame-Options',
value: 'SAMEORIGIN',
},
{
key: 'X-XSS-Protection',
value: '1; mode=block',
},
{
key: 'X-Content-Type-Options',
value: 'nosniff',
},
// {
// key: 'Content-Security-Policy',
// value: "default-src 'unsafe-inline' sciteens.org prismic.io googleapis.com gstatic.com googleusercontent.com"
// },
{
key: 'Referrer-Policy',
value: 'origin-when-cross-origin',
},
{
key: 'Permissions-Policy',
value:
'accelerometer=(self), ambient-light-sensor=(self), autoplay=(self), battery=(self), camera=(self), cross-origin-isolated=(self), display-capture=(self), document-domain=(self), encrypted-media=(self), execution-while-not-rendered=(self), execution-while-out-of-viewport=(self), fullscreen=(self), geolocation=(self), gyroscope=(self), keyboard-map=(self), magnetometer=(self), microphone=(self), midi=(self), navigation-override=(self), payment=(self), picture-in-picture=(self), publickey-credentials-get=(self), screen-wake-lock=(self), sync-xhr=(self), usb=(self), web-share=(self), xr-spatial-tracking=(self)',
},
{
key: 'X-DNS-Prefetch-Control',
value: 'on',
},
],
},
]
},
webpack: function (config) {
config.plugins.push(new CompressionPlugin());
config.plugins.push(new ImageMinimizerPlugin(
{
minimizer: {
implementation: ImageMinimizerPlugin.squooshMinify,
options: {
encodeOptions: {
mozjpeg: {
quality: 85,
},
webp: {
lossless: 1,
},
avif: {
cqLevel: 0,
},
},
},
},
}
));
return config;
}
}