-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
59 lines (53 loc) · 1.96 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 path = require('path')
const pkgjson = require('./package.json')
const {
PHASE_PRODUCTION_BUILD,
PHASE_PRODUCTION_SERVER
} = require('next/constants')
const webpack = (config) => {
const adjustedConf = { ...config }
const experiments = config.experiments || {}
adjustedConf.experiments = { ...experiments, syncWebAssembly: true }
adjustedConf.resolve.alias = {
...config.resolve.alias,
react: path.resolve('./node_modules/react'),
'react-dom': path.resolve('./node_modules/react-dom'),
next: path.resolve('./node_modules/next'),
'styled-components': path.resolve('./node_modules/styled-components'),
'@glif/react-components': path.resolve(
'./node_modules/@glif/react-components'
)
}
return adjustedConf
}
module.exports = (phase) => {
return {
trailingSlash: true,
webpack,
env: {
NEXT_PUBLIC_PACKAGE_NAME: pkgjson.name,
NEXT_PUBLIC_PACKAGE_VERSION: pkgjson.version,
NEXT_PUBLIC_HOME_URL: process.env.HOME_URL || 'https://glif.io',
NEXT_PUBLIC_BLOG_URL: process.env.BLOG_URL || 'https://blog.glif.io/',
NEXT_PUBLIC_WALLET_URL:
process.env.WALLET_URL || 'https://wallet-calibration.glif.link',
NEXT_PUBLIC_SAFE_URL:
process.env.SAFE_URL || 'https://safe-calibration.glif.link',
NEXT_PUBLIC_EXPLORER_URL:
process.env.EXPLORER_URL || 'https://explorer-calibration.glif.link',
NEXT_PUBLIC_VERIFIER_URL:
process.env.VERIFIER_URL || 'https://verify-calibration.glif.link',
NEXT_PUBLIC_SENTRY_DSN: process.env.SENTRY_DSN || '',
NEXT_PUBLIC_SENTRY_ENV: process.env.SENTRY_ENV || '',
...(phase === PHASE_PRODUCTION_SERVER || phase === PHASE_PRODUCTION_BUILD
? {
NEXT_PUBLIC_COIN_TYPE: process.env.COIN_TYPE || 'f', // 461'
NEXT_PUBLIC_IS_PROD: true
}
: {
NEXT_PUBLIC_COIN_TYPE: process.env.COIN_TYPE || 't', // 1'
NEXT_PUBLIC_IS_PROD: false
})
}
}
}