-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
30 lines (26 loc) · 1.12 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
// This section describes configurations at the client compilation/build stage and is not included in the browser build.
// This is a normal module Node.js.
const secrets = require('./docker.secrets');
function isDevelopment() {
return !process.env.NODE_ENV || process.env.NODE_ENV === 'development';
}
const imageDomains = [];
const runtime = {
development_host: process.env.API_HOST_DEV || secrets.read('api_host_dev.secret') || 'http://127.0.0.1:3001',
production_host: process.env.API_HOST || secrets.read('api_host.secret'),
development_cdn_host: process.env.CDN_HOST_DEV || secrets.read('cdn_host_dev.secret') || 'http://127.0.0.1:1337',
production_cdn_host: process.env.CDN_HOST || secrets.read('api_host.secret'),
};
if (isDevelopment()) {
imageDomains.push('http://127.0.0.1:1337', 'avatars1.githubusercontent.com', 'habrastorage.org', 'hsto.org', 'mediafanbox.online');
} else {
if (typeof runtime.production_cdn_host == 'string') {
imageDomains.push(runtime.production_cdn_host)
}
}
module.exports = {
images: {
domains: imageDomains,
},
publicRuntimeConfig: runtime,
}