-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
40 lines (34 loc) · 1.11 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
const path = require('path');
const { readFileSync } = require('fs');
const configFileLocation = path.join(process.env.CONFIG_FILE_DIR || "./envcfg", "competition.json");
const logoUrl = JSON.parse(readFileSync(configFileLocation, "utf8"))?.logoUrl;
console.log(logoUrl.split("://")[1].split("/")[0]);
if (typeof logoUrl !== "string" || !logoUrl) {
throw new Error("competition.json is not valid");
}
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
swcMinify: true,
sassOptions: {
includePaths: [
path.join(__dirname, 'styles'),
path.join(__dirname, 'lib/**'),
],
},
images: {
// assumes http or https preprended, and trailing
domains: [ logoUrl.split("://")[1].split("/")[0] ],
// domains: [ "storage.googleapis.com" ],
},
async redirects() { // TODO --> remove this when the settings page gets added
return [
{
source: '/account/settings',
destination: '/404',
permanent: true,
},
]
},
}
module.exports = nextConfig