forked from GoodDollar/GoodDAPP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshim.js
22 lines (19 loc) · 750 Bytes
/
shim.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
if (typeof __dirname === 'undefined') global.__dirname = '/'
if (typeof __filename === 'undefined') global.__filename = ''
// Needed so that 'stream-http' chooses the right default protocol.
global.location = {
protocol: 'file:',
}
global.process = require('process')
// global.process.version = 'v0.10';
global.process.browser = false
global.process.release = { name: 'gooddollar-wallet' }
const isDev = typeof __DEV__ === 'boolean' && __DEV__
process.env['NODE_ENV'] = isDev ? 'development' : 'production'
if (typeof localStorage !== 'undefined') {
localStorage.debug = isDev ? '*' : ''
}
global.btoa = require('Base64').btoa
global.atob = require('Base64').atob
global.Buffer = require('buffer').Buffer
// global.crypto = require('crypto')