-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
62 lines (57 loc) · 1.52 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
// eslint-disable-next-line @typescript-eslint/no-var-requires
const path = require("path");
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 "investigations-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
},
];
},
experimental: {
isrMemoryCacheSize: 0,
forceSwcTransforms: true,
optimizePackageImports: ["@rubin-epo/epo-react-lib"],
},
swcMinify: true,
compiler: {
// Enables the styled-components SWC transform
styledComponents: true,
},
typescript: {
ignoreBuildErrors: true,
},
sassOptions: {
includePaths: [
path.join(__dirname, "theme/styles"),
path.join(__dirname, "components"),
],
},
webpack(config) {
config.externals.push({ "skia-canvas": "skia-canvas" });
return config;
},
logging: {
level: "verbose",
fetches: {
fullUrl: true,
},
},
};