-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
59 lines (54 loc) · 1.43 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
const nextRuntimeDotenv = require('next-runtime-dotenv');
const withConfig = nextRuntimeDotenv({
path: '.env',
public: [],
server: [],
});
const allowedCDNs = [
'radio-crestin.s3.amazonaws.com',
'radio-crestin.s3.eu-central-1.amazonaws.com',
'cdn.pictures.aripisprecer.ro',
'pictures.aripisprecer.ro',
'images.radio.co',
];
const config = withConfig({
reactStrictMode: true,
output: 'standalone',
images: {
formats: ['image/webp'],
domains: allowedCDNs,
imageSizes: [16, 32, 48, 64, 96, 128, 256, 384, 480, 640],
minimumCacheTTL: 60 * 60 * 24,
},
env: {
cdnPrefix:
process.env.FRONTEND_CDN_IMAGE_PREFIX !== ''
? process.env.FRONTEND_CDN_IMAGE_PREFIX
: '',
},
// Use the CDN in production and localhost for development.
assetPrefix:
process.env.FRONTEND_CDN_IMAGE_PREFIX !== ''
? process.env.FRONTEND_CDN_IMAGE_PREFIX
: undefined,
compiler: {
removeConsole:
process.env.NODE_ENV === 'development'
? false
: {
exclude: ['error'],
},
},
});
console.log('process.env.FRONTEND_CDN_IMAGE_PREFIX', process.env.FRONTEND_CDN_IMAGE_PREFIX);
if (process.env.ANALYZE === 'true') {
console.log('ANALYZE is enabled.');
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
});
module.exports = {
...withBundleAnalyzer(config),
};
} else {
module.exports = config;
}