diff options
author | Marian Oancea <contact@siteshop.ro> | 2014-11-06 01:46:01 +0800 |
---|---|---|
committer | Marian Oancea <contact@siteshop.ro> | 2014-11-06 01:46:01 +0800 |
commit | 4be4db5e6cfdde4ba5c1243b2bafeb6bbae3643c (patch) | |
tree | c368675984eb642f13334f2e61f6401d58776863 /gulpfile.js | |
parent | 3e174a08790ca009a2107a3564b179ae1f036c33 (diff) | |
download | go-tangerine-4be4db5e6cfdde4ba5c1243b2bafeb6bbae3643c.tar go-tangerine-4be4db5e6cfdde4ba5c1243b2bafeb6bbae3643c.tar.gz go-tangerine-4be4db5e6cfdde4ba5c1243b2bafeb6bbae3643c.tar.bz2 go-tangerine-4be4db5e6cfdde4ba5c1243b2bafeb6bbae3643c.tar.lz go-tangerine-4be4db5e6cfdde4ba5c1243b2bafeb6bbae3643c.tar.xz go-tangerine-4be4db5e6cfdde4ba5c1243b2bafeb6bbae3643c.tar.zst go-tangerine-4be4db5e6cfdde4ba5c1243b2bafeb6bbae3643c.zip |
Converted to node module
Converted to npm package
Added brower
Added browserify with minification
Updated Readme
Diffstat (limited to 'gulpfile.js')
-rw-r--r-- | gulpfile.js | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/gulpfile.js b/gulpfile.js new file mode 100644 index 000000000..de893a4f5 --- /dev/null +++ b/gulpfile.js @@ -0,0 +1,56 @@ +#!/usr/bin/env node + +'use strict'; + +var del = require('del'); +var gulp = require('gulp'); +var browserify = require('gulp-browserify-thin'); +var jshint = require('gulp-jshint'); +var uglify = require("gulp-uglify"); +var rename = require("gulp-rename"); +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('build', ['clean'], function () { + return browserify() + .require('./index.js', { expose: 'web3'}) + .bundle('ethereum.js') + .on('error', function(err) + { + console.error(err.toString()); + process.exit(1); + }) + .pipe(gulp.dest( DEST )); +}); + +gulp.task('minify', ['build'], function(){ + return gulp.src( DEST + 'ethereum.js') + .pipe(gulp.dest( DEST )) + .pipe(uglify()) + .pipe(rename('ethereum.min.js')) + .pipe(gulp.dest( DEST )); +}); + +gulp.task('watch', function() { + gulp.watch(['./lib/*.js'], ['lint', 'build', 'minify']); +}); + +gulp.task('default', ['bower', 'lint', 'build', 'minify']); |