link-stack/apps/leafcutter/next.config.js

58 lines
1.1 KiB
JavaScript
Raw Permalink Normal View History

2023-06-28 09:09:45 +00:00
const ContentSecurityPolicy = `
default-src 'self';
script-src 'self';
child-src example.com;
style-src 'self' example.com;
font-src 'self';
`;
2023-02-13 13:46:56 +00:00
module.exports = {
2023-08-25 07:11:33 +00:00
transpilePackages: ["leafcutter-common"],
rewrites: async () => ({
fallback: [
{
source: "/:path*",
destination: "/api/proxy/:path*",
},
],
}),
/*
2023-05-30 09:05:40 +00:00
basePath: "/proxy/leafcutter",
assetPrefix: "/proxy/leafcutter",
2023-02-13 13:46:56 +00:00
i18n: {
locales: ["en", "fr"],
defaultLocale: "en",
},
2023-06-28 09:09:45 +00:00
*/
2023-08-25 07:11:33 +00:00
/*
2023-06-28 09:09:45 +00:00
async headers() {
return [
{
source: '/:path*',
headers: [
2023-08-25 07:11:33 +00:00
2023-06-28 09:09:45 +00:00
{
key: 'Content-Security-Policy',
value: ContentSecurityPolicy.replace(/\s{2,}/g, ' ').trim()
},
2023-08-25 07:11:33 +00:00
2023-06-28 09:09:45 +00:00
{
key: 'Strict-Transport-Security',
value: 'max-age=63072000; includeSubDomains; preload'
},
{
key: 'X-XSS-Protection',
value: '1; mode=block'
},
{
key: 'X-Frame-Options',
value: 'SAMEORIGIN'
}
],
},
]
}
2023-08-25 07:11:33 +00:00
*/
2023-02-13 13:46:56 +00:00
};