/
next.config.js
46 lines (45 loc) · 1.23 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
const path = require('path');
const { i18n } = require('./next-i18next.config');
const ContentSecurityPolicy = `
connect-src 'self' https://checkout.stripe.com;
frame-src 'self' https://js.stripe.com;
script-src 'self' https://js.stripe.com 'unsafe-inline' 'unsafe-eval';
style-src 'self' 'unsafe-inline';
font-src 'self';
`;
// https://checkout.stripe.com
/** @type {import('next').NextConfig} */
const nextConfig = {
i18n,
reactStrictMode: false,
output: 'standalone',
transpilePackages: ['echarts', 'sealos@ui'],
experimental: {
// this includes files from the monorepo base two directories up
outputFileTracingRoot: path.join(__dirname, '../../')
},
async headers() {
console.log(ContentSecurityPolicy.replace(/\s{2,}/g, ' ').trim());
return [
{
source: '/',
headers: [
{
key: 'Content-Security-Policy',
value: ContentSecurityPolicy.replace(/\s{2,}/g, ' ').trim()
}
]
},
{
source: '/cost_overview',
headers: [
{
key: 'Content-Security-Policy',
value: ContentSecurityPolicy.replace(/\s{2,}/g, ' ').trim()
}
]
}
];
}
};
module.exports = nextConfig;