light browser bundle without bignumber.js

This commit is contained in:
Marek Kotewicz 2015-03-23 17:29:50 +01:00
parent ae76428d63
commit 4b371372b7
6 changed files with 2951 additions and 4 deletions

2862
dist/light/ethereum.js vendored Normal file

File diff suppressed because it is too large Load Diff

63
dist/light/ethereum.js.map vendored Normal file

File diff suppressed because one or more lines are too long

1
dist/light/ethereum.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -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');

View File

@ -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']);

4
lib/utils/browser-bn.js Normal file
View File

@ -0,0 +1,4 @@
'use strict';
module.exports = window.BigNumber;