moved to BN.js

This commit is contained in:
Fabian Vogelsteller 2017-02-23 18:26:02 +01:00
parent acf45217d3
commit 8503ac8884
No known key found for this signature in database
GPG Key ID: E51EADA77F1A4124
3 changed files with 7 additions and 8 deletions

View File

@ -8,8 +8,7 @@
"./dist/web3.min.js"
],
"dependencies": {
"bignumber.js": ">=2.0.0",
"crypto-js": "~3.1.4"
"bn.js": ">=4.11.6"
},
"repository": {
"type": "git",

View File

@ -61,8 +61,8 @@ gulp.task('clean', ['lint'], function(cb) {
gulp.task('light', ['clean'], function () {
return browserify(browserifyOptions)
.require('./' + src + '.js', {expose: 'web3'})
.ignore('bignumber.js')
.require('./lib/utils/browser-bn.js', {expose: 'bignumber.js'}) // fake bignumber.js
.ignore('bn.js')
.require('./lib/utils/browser-bn.js', {expose: 'bn.js'}) // fake bn.js
.add('./' + src + '.js')
.bundle()
.pipe(exorcist(path.join( DEST, lightDst + '.js.map')))
@ -76,7 +76,7 @@ gulp.task('light', ['clean'], function () {
gulp.task('standalone', ['clean'], function () {
return browserify(browserifyOptions)
.require('./' + src + '.js', {expose: 'web3'})
.require('bignumber.js') // expose it to dapp users
.require('bn.js') // expose it to dapp users
.add('./' + src + '.js')
.ignore('crypto')
.bundle()

View File

@ -4,14 +4,14 @@
// Browser environment
if(typeof window !== 'undefined') {
Web3 = (typeof window.Web3 !== 'undefined') ? window.Web3 : require('web3');
BigNumber = (typeof window.BigNumber !== 'undefined') ? window.BigNumber : require('bignumber.js');
BigNumber = (typeof window.BigNumber !== 'undefined') ? window.BigNumber : require('bn.js');
}
// Node environment
if(typeof global !== 'undefined') {
Web3 = (typeof global.Web3 !== 'undefined') ? global.Web3 : require('web3');
BigNumber = (typeof global.BigNumber !== 'undefined') ? global.BigNumber : require('bignumber.js');
BigNumber = (typeof global.BigNumber !== 'undefined') ? global.BigNumber : require('bn.js');
}
/* jshint ignore:end */