mirror of https://github.com/status-im/web3.js.git
light browser bundle without bignumber.js
This commit is contained in:
parent
ae76428d63
commit
4b371372b7
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -3,7 +3,7 @@
|
|||
|
||||
<head>
|
||||
<script type="text/javascript" src="js/bignumber.js/bignumber.min.js"></script>
|
||||
<script type="text/javascript" src="../dist/ethereum.js"></script>
|
||||
<script type="text/javascript" src="../dist/light/ethereum.js"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
var web3 = require('ethereum.js');
|
||||
|
|
23
gulpfile.js
23
gulpfile.js
|
@ -18,6 +18,7 @@ var streamify = require('gulp-streamify');
|
|||
var replace = require('gulp-replace');
|
||||
|
||||
var DEST = './dist/';
|
||||
var DEST2 = './dist/light/'; // jshint ignore:line
|
||||
var src = 'index';
|
||||
var dst = 'ethereum';
|
||||
|
||||
|
@ -54,7 +55,22 @@ gulp.task('lint', function(){
|
|||
.pipe(jshint.reporter('default'));
|
||||
});
|
||||
|
||||
gulp.task('build', ['clean'], function () {
|
||||
gulp.task('buildNormal', ['clean'], function () {
|
||||
return browserify(browserifyOptions)
|
||||
.require('./' + src + '.js', {expose: 'ethereum.js'})
|
||||
.ignore('bignumber.js')
|
||||
.require('./lib/utils/browser-bn.js', {expose: 'bignumber.js'}) // fake bignumber.js
|
||||
.add('./' + src + '.js')
|
||||
.bundle()
|
||||
.pipe(exorcist(path.join( DEST2, dst + '.js.map')))
|
||||
.pipe(source(dst + '.js'))
|
||||
.pipe(gulp.dest( DEST2 ))
|
||||
.pipe(streamify(uglify()))
|
||||
.pipe(rename(dst + '.min.js'))
|
||||
.pipe(gulp.dest( DEST2 ));
|
||||
});
|
||||
|
||||
gulp.task('buildStandalone', ['clean'], function () {
|
||||
return browserify(browserifyOptions)
|
||||
.require('./' + src + '.js', {expose: 'ethereum.js'})
|
||||
.require('bignumber.js') // expose it to dapp users
|
||||
|
@ -73,8 +89,9 @@ gulp.task('watch', function() {
|
|||
gulp.watch(['./lib/*.js'], ['lint', 'build']);
|
||||
});
|
||||
|
||||
gulp.task('dev', ['versionReplace','bower', 'lint', 'build']);
|
||||
gulp.task('default', ['dev']);
|
||||
gulp.task('normal', ['versionReplace','bower', 'lint', 'buildNormal']);
|
||||
gulp.task('standalone', ['versionReplace','bower', 'lint', 'buildStandalone']);
|
||||
gulp.task('default', ['normal', 'standalone']);
|
||||
|
||||
|
||||
gulp.task('version', ['versionReplace']);
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
'use strict';
|
||||
|
||||
module.exports = window.BigNumber;
|
||||
|
Loading…
Reference in New Issue