-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
75 lines (72 loc) · 1.73 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
const path = require("path");
const nextBuildId = require("next-build-id");
let API_URL;
// Check to see if the environment variable DOCKER_GATEWAY_IP is populated, if so
// then the URL should be constructed for a Docker static build
if (
process.env.DOCKERIZED &&
process.env.DOCKER_GATEWAY_IP &&
parseInt(process.env.DOCKER_GATEWAY_IP) !== -1 && // The getApiGatewayURL script returns -1 if an error occurs grabbing the IP
process.env.DOCKER_GATEWAY_PORT
) {
API_URL = `http://${process.env.DOCKER_GATEWAY_IP}:${process.env.DOCKER_GATEWAY_PORT}`;
}
module.exports = {
async generateBuildId() {
return "rubin-obs-client-next-build-id";
},
async rewrites() {
return [
{
source: "/assets/:path*",
destination: API_URL
? `${API_URL}/assets/:path*`
: "http://localhost:9000/assets/:path*", // Proxy to Backend
},
];
},
images: {
remotePatterns: [
{
protocol: "https",
hostname: "storage.googleapis.com",
},
{
protocol: "https",
hostname: "rubin.canto.com",
},
{
protocol: "https",
hostname: "noirlab.edu",
},
],
},
experimental: {
forceSwcTransforms: true,
},
cacheMaxMemorySize: 0,
staticPageGenerationTimeout: 2000,
typescript: {
ignoreBuildErrors: true,
},
swcMinify: true,
compiler: {
// Enables the styled-components SWC transform
styledComponents: {
ssr: true,
},
},
sassOptions: {
includePaths: [
path.join(__dirname, "theme/styles"),
path.join(__dirname, "components"),
],
},
webpack: (config) => {
config.resolve.fallback = {
...config.resolve.fallback,
fs: false,
};
return config;
},
};