diff options
author | Marian Oancea <contact@siteshop.ro> | 2014-11-11 18:15:36 +0800 |
---|---|---|
committer | Marian Oancea <contact@siteshop.ro> | 2014-11-11 18:15:36 +0800 |
commit | dea68f073e9a071e3e3940f7a467bf3cdc8d1992 (patch) | |
tree | 469ed412825f3426148baaf186436f44c6a851f5 /gulpfile.js | |
parent | 720365859cfc56a6b59f6824f61138ed7ea8a782 (diff) | |
parent | 7af9cc70d01b3549de1b90afce591376ec554737 (diff) | |
download | go-tangerine-dea68f073e9a071e3e3940f7a467bf3cdc8d1992.tar go-tangerine-dea68f073e9a071e3e3940f7a467bf3cdc8d1992.tar.gz go-tangerine-dea68f073e9a071e3e3940f7a467bf3cdc8d1992.tar.bz2 go-tangerine-dea68f073e9a071e3e3940f7a467bf3cdc8d1992.tar.lz go-tangerine-dea68f073e9a071e3e3940f7a467bf3cdc8d1992.tar.xz go-tangerine-dea68f073e9a071e3e3940f7a467bf3cdc8d1992.tar.zst go-tangerine-dea68f073e9a071e3e3940f7a467bf3cdc8d1992.zip |
Merge branch 'debris-subprotocol_prefix_merge'
Diffstat (limited to 'gulpfile.js')
-rw-r--r-- | gulpfile.js | 70 |
1 files changed, 43 insertions, 27 deletions
diff --git a/gulpfile.js b/gulpfile.js index 987c127ba..7758a38e0 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -16,27 +16,9 @@ var source = require('vinyl-source-stream'); var exorcist = require('exorcist'); var bower = require('bower'); - var DEST = './dist/'; -gulp.task('bower', function(cb){ - bower.commands.install().on('end', function (installed){ - console.log(installed); - cb(); - }); -}); - -gulp.task('lint', function(){ - return gulp.src(['./*.js', './lib/*.js']) - .pipe(jshint()) - .pipe(jshint.reporter('default')); -}); - -gulp.task('clean', ['lint'], function(cb) { - del([ DEST ], cb); -}); - -gulp.task('prepare', ['clean'], function () { +var build = function(src, dst) { return browserify({ debug: true, insert_global_vars: false, @@ -44,7 +26,7 @@ gulp.task('prepare', ['clean'], function () { bundleExternal: false }) .add('./') - .require('./index.js', {expose: 'web3'}) + .require('./' + src + '.js', {expose: 'web3'}) .transform('envify', { NODE_ENV: 'build' }) @@ -63,20 +45,54 @@ gulp.task('prepare', ['clean'], function () { warnings: true }) .bundle() - .pipe(exorcist(path.join( DEST, 'ethereum.js.map'))) - .pipe(source('ethereum.js')) + .pipe(exorcist(path.join( DEST, dst + '.js.map'))) + .pipe(source(dst + '.js')) .pipe(gulp.dest( DEST )); -}); +}; -gulp.task('build', ['prepare'], function(){ - return gulp.src( DEST + 'ethereum.js') +var uglifyFile = function(file) { + return gulp.src( DEST + file + '.js') .pipe(uglify()) - .pipe(rename('ethereum.min.js')) + .pipe(rename(file + '.min.js')) .pipe(gulp.dest( DEST )); +}; + +gulp.task('bower', function(cb){ + bower.commands.install().on('end', function (installed){ + console.log(installed); + cb(); + }); +}); + +gulp.task('lint', function(){ + return gulp.src(['./*.js', './lib/*.js']) + .pipe(jshint()) + .pipe(jshint.reporter('default')); +}); + +gulp.task('clean', ['lint'], function(cb) { + del([ DEST ], cb); +}); + +gulp.task('build', ['clean'], function () { + return build('index', 'ethereum'); +}); + +gulp.task('buildQt', ['clean'], function () { + return build('index_qt', 'ethereum_qt'); +}); + +gulp.task('uglify', ['build'], function(){ + return uglifyFile('ethereum'); +}); + +gulp.task('uglifyQt', ['buildQt'], function () { + return uglifyFile('ethereum_qt'); }); gulp.task('watch', function() { gulp.watch(['./lib/*.js'], ['lint', 'prepare', 'build']); }); -gulp.task('default', ['bower', 'lint', 'prepare', 'build']); +gulp.task('default', ['bower', 'lint', 'build', 'uglify']); +gulp.task('qt', ['bower', 'lint', 'buildQt', 'uglifyQt']); |