-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfig-overrides.js
34 lines (27 loc) · 979 Bytes
/
config-overrides.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
// DO NOT TOUCH! This is only used during development!
const webpack = require('webpack')
module.exports = function override(config) {
if (process.env.NODE_ENV === 'production') {
const issuerId = process.env.ISSUER_ID
if (!issuerId) throw new Error('Please provide issuerId')
config.plugins = [
...config.plugins,
new webpack.NormalModuleReplacementPlugin(
/__development__\/combined-registry/,
`templates/${issuerId}`
),
]
return config
}
if (process.env.IS_PREVIEW_APP === 'true') {
const fallback = config.resolve.fallback || {}
Object.assign(fallback, {
crypto: require.resolve('crypto-browserify'),
stream: require.resolve('stream-browserify'),
})
config.resolve.fallback = fallback
config.entry = './src/__development__/preview.tsx'
return config
}
return config
}