-
Notifications
You must be signed in to change notification settings - Fork 27
/
next.config.js
52 lines (38 loc) · 1.21 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
/* eslint-env node */
const crypto = require('crypto')
const ciEnv = require('./.config/ciEnv')
const env = require('./.config/env')
const headersConfig = require('./.config/headers.config')
const publicRuntimeConfig = require('./.config/publicRuntime.config')
const redirectsConfig = require('./.config/redirects.config')
const rewritesConfig = require('./.config/rewrites.config')
const webpackConfig = require('./.config/webpack.config')
// Constants
const DEV_BUILD_ID_LENGTH = 16
module.exports = () => {
return {
distDir: 'dist',
images: {
disableStaticImages: true,
domains: [
'wordpress.fuelrats.com',
'static-cdn.jtvnw.net',
],
},
eslint: {
// Ignore ESLint in builds as our CI Takes care of this for us.
ignoreDuringBuilds: true,
},
headers: headersConfig(env),
publicRuntimeConfig: publicRuntimeConfig(env),
redirects: redirectsConfig(env),
rewrites: rewritesConfig(env),
webpack: webpackConfig(env),
generateBuildId: () => {
const buildId = ciEnv.isCi
? ciEnv.commit
: crypto.randomBytes(DEV_BUILD_ID_LENGTH).toString('hex').toLowerCase()
return `${ciEnv.branch}_${buildId}`
},
}
}