link-stack/apps/leafcutter/next.config.js
Darren Clarke b09cc82544 WIP 5
2024-03-20 17:51:21 +01:00

60 lines
1.2 KiB
JavaScript

const ContentSecurityPolicy = `
default-src 'self';
script-src 'self';
child-src example.com;
style-src 'self' example.com;
font-src 'self';
`;
module.exports = {
transpilePackages: ["leafcutter-ui", "opensearch-common"],
experimental: {
missingSuspenseWithCSRBailout: false,
},
rewrites: async () => ({
fallback: [
{
source: "/:path*",
destination: "/api/proxy/:path*",
},
],
}),
/*
basePath: "/proxy/leafcutter",
assetPrefix: "/proxy/leafcutter",
i18n: {
locales: ["en", "fr"],
defaultLocale: "en",
},
*/
/*
async headers() {
return [
{
source: '/:path*',
headers: [
{
key: 'Content-Security-Policy',
value: ContentSecurityPolicy.replace(/\s{2,}/g, ' ').trim()
},
{
key: 'Strict-Transport-Security',
value: 'max-age=63072000; includeSubDomains; preload'
},
{
key: 'X-XSS-Protection',
value: '1; mode=block'
},
{
key: 'X-Frame-Options',
value: 'SAMEORIGIN'
}
],
},
]
}
*/
};