-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnext.config.js
executable file
·40 lines (35 loc) · 1016 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
/** @type {import('next').NextConfig} */
const createNextIntlPlugin = require('next-intl/plugin');
const withNextIntl = createNextIntlPlugin();
const ssr = require('@navikt/nav-dekoratoren-moduler/ssr');
const appDirectives = {
'connect-src': ["'self'"],
'font-src': ['https://fonts.gstatic.com'],
'object-src': ['blob:'],
'script-src-elem': ["'self'"],
'style-src-elem': ["'self'"],
'frame-src': ['self', 'blob:'],
'img-src': ["'self'", 'data:', 'blob:'],
};
const nextConfig = {
basePath: '/aap/mine-aap',
trailingSlash: true,
reactStrictMode: true,
output: 'standalone',
assetPrefix: process.env.ASSET_PREFIX ?? undefined,
async headers() {
const csp = await ssr.buildCspHeader(appDirectives, { env: process.env.DECORATOR_ENV ?? 'prod' });
return [
{
source: '/:path*',
headers: [
{
key: 'Content-Security-Policy',
value: csp,
},
],
},
];
},
};
module.exports = withNextIntl(nextConfig);