2021-03-05 01:32:00 +02:00
|
|
|
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
|
|
|
2021-03-13 02:27:31 +02:00
|
|
|
// To be included in dependencies, chakra-ui depends on it but has it as peer dependency
|
|
|
|
require("framer-motion");
|
|
|
|
|
2021-01-07 15:09:56 +02:00
|
|
|
module.exports = {
|
|
|
|
poweredByHeader: false,
|
|
|
|
reactStrictMode: true,
|
2021-03-09 19:52:19 +02:00
|
|
|
assetPrefix: process.env.ASSET_PREFIX ? process.env.ASSET_PREFIX : "",
|
2021-04-01 14:09:58 +02:00
|
|
|
publicRuntimeConfig: {
|
2021-04-02 14:35:35 +02:00
|
|
|
PUBLIC_URL: process.env.PUBLIC_URL,
|
|
|
|
CF_WEB_ANALYTICS: process.env.CF_WEB_ANALYTICS,
|
2021-04-01 14:09:58 +02:00
|
|
|
},
|
2021-03-05 01:32:00 +02:00
|
|
|
webpack(config, options) {
|
|
|
|
const { dev, isServer } = options;
|
|
|
|
|
2021-03-10 00:48:16 +02:00
|
|
|
// Do not run type checking twice
|
2021-03-05 01:32:00 +02:00
|
|
|
if (dev && isServer) {
|
2021-03-06 23:54:18 +02:00
|
|
|
const ForkTsCheckerWebpackPlugin = require("fork-ts-checker-webpack-plugin");
|
2021-03-05 01:32:00 +02:00
|
|
|
config.plugins.push(new ForkTsCheckerWebpackPlugin());
|
|
|
|
}
|
|
|
|
|
2021-12-03 11:32:10 +02:00
|
|
|
if (!config.experiments) {
|
|
|
|
config.experiments = {};
|
|
|
|
}
|
|
|
|
config.experiments.asyncWebAssembly = true;
|
|
|
|
|
2021-03-05 01:32:00 +02:00
|
|
|
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",
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
];
|
|
|
|
},
|
2021-01-07 15:09:56 +02:00
|
|
|
};
|