-
Notifications
You must be signed in to change notification settings - Fork 16
/
next.config.js
36 lines (31 loc) · 955 Bytes
/
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
const path = require('path')
const { execSync } = require('child_process')
const withCSS = require('@zeit/next-css')
const withImages = require('next-images')
const withFonts = require('next-fonts')
const { fullEnvironment } = require('./lib/environment')
const { version } = require('./package.json')
const COMMIT_SHA =
process.env.COMMIT_SHA ||
process.env.NOW_GITHUB_COMMIT_SHA ||
execSync("git log --pretty=format:'%h' -n 1")
const BUILD = process.env.BUILD || `${version}-${COMMIT_SHA.slice(0, 7)}`
const ENV = fullEnvironment()
// Defined by Next
delete ENV.NODE_ENV
module.exports = withCSS(
withFonts(
withImages({
webpack(config, options) {
return ['lib', 'components'].reduce((config, dirname) => {
config.resolve.alias[dirname] = path.join(__dirname, dirname)
return config
}, config)
},
env: ENV,
devIndicators: {
autoPrerender: false,
},
})
)
)