1
0
mirror of https://github.com/barthuijgen/factorio-sites.git synced 2024-12-13 11:53:54 +02:00
factorio-sites/apps/blueprints/next.config.js

66 lines
1.8 KiB
JavaScript
Raw Permalink Normal View History

/* eslint-disable @typescript-eslint/no-var-requires */
// To be included in dependencies, chakra-ui depends on it but has it as peer dependency
require("framer-motion");
module.exports = {
poweredByHeader: false,
reactStrictMode: true,
2021-03-09 19:52:19 +02:00
assetPrefix: process.env.ASSET_PREFIX ? process.env.ASSET_PREFIX : "",
publicRuntimeConfig: {
2021-04-02 14:35:35 +02:00
PUBLIC_URL: process.env.PUBLIC_URL,
CF_WEB_ANALYTICS: process.env.CF_WEB_ANALYTICS,
},
webpack(config, options) {
const { dev, isServer } = options;
// Do not run type checking twice
if (dev && isServer) {
const ForkTsCheckerWebpackPlugin = require("fork-ts-checker-webpack-plugin");
config.plugins.push(new ForkTsCheckerWebpackPlugin());
}
if (!config.experiments) {
config.experiments = {};
}
config.experiments.asyncWebAssembly = true;
return config;
},
2021-04-13 10:50:40 +02:00
async headers() {
return [
{
source: "/(.*)",
headers: [
{
key: "Permissions-Policy",
value: "interest-cohort=()",
},
{
key: "Referrer-Policy",
value: "no-referrer",
},
{
key: "Strict-Transport-Security",
value: "max-age=31536000; includeSubDomains",
},
{
2021-04-17 13:04:15 +02:00
key: "Content-Security-Policy-Report-Only",
2021-04-13 12:07:09 +02:00
// 'unsafe-eval' and 'worker-src blob:' are required for wasm
2021-04-13 10:50:40 +02:00
value:
2021-04-13 12:07:09 +02:00
"script-src 'self' 'unsafe-eval' https://factorio-blueprints-assets.storage.googleapis.com https://static.cloudflareinsights.com ; worker-src blob: ;",
2021-04-13 10:50:40 +02:00
},
{
key: "X-Frame-Options",
value: "SAMEORIGIN",
},
{
key: "X-Content-Type-Options",
value: "nosniff",
},
],
},
];
},
};