-
Notifications
You must be signed in to change notification settings - Fork 2
/
next.config.js
57 lines (54 loc) · 1.41 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
const { i18n } = require('./next-i18next.config')
//formatting TC Date
const builddate = process.env.BUILD_DATE
? process.env.BUILD_DATE.substring(0, 4) +
'-' +
process.env.BUILD_DATE.substring(4, 6) +
'-' +
process.env.BUILD_DATE.substring(6, 8)
: new Date().toLocaleDateString()
const securityHeaders = [
{
key: 'X-Frame-Options',
value: 'DENY',
},
{
key: 'Content-Security-Policy',
value:
"default-src 'self'; base-uri 'self'; frame-ancestors 'self'; form-action 'self'; object-src 'none'; script-src-elem 'self'; script-src 'self' 'unsafe-eval'; connect-src 'self'; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com; img-src 'self' data: https:",
},
{
key: 'X-Content-Type-Options',
value: 'nosniff',
},
{
key: 'Permissions-Policy',
value: 'camera=(); battery=(); geolocation=(); microphone=()',
},
{
key: 'Referrer-Policy',
value: 'origin-when-cross-origin',
},
]
/** @type {import('next').NextConfig} */
module.exports = {
env: {
NEXT_PUBLIC_BUILD_DATE: builddate,
LOGGING_LEVEL: process.env.LOGGING_LEVEL,
},
experimental: {
instrumentationHook: true,
},
output: 'standalone',
productionBrowserSourceMaps: true,
reactStrictMode: true,
i18n,
async headers() {
return [
{
source: '/(.*)',
headers: securityHeaders,
},
]
},
}