diff --git a/gulpfile.js b/gulpfile.js index 918ea7a..3352ee9 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -8,6 +8,7 @@ var clean = require('gulp-clean') var exorcist = require('exorcist') var connect = require('gulp-connect') var watchify = require('watchify') +var util = require('gulp-util') var config = { files: { @@ -33,27 +34,31 @@ gulp.task('html',function(){ .pipe(connect.reload()) }) -gulp.task('js',function(){ - return applyBrowserify(getBrowserify()) -}) - gulp.task('js-watch',function(){ - var b = watchify(getBrowserify()) + var b = getBrowserify() + b.on('log',function(l){ + util.log(l) + }) b.on('error',function(error){ - console.log(error) + util.log(error) }) b.on('update', function(){ - console.log('Rebundling') + util.log('Rebundling') applyBrowserify(b) }) - return b + return applyBrowserify(b) +}) + +gulp.task('js',function(){ + return applyBrowserify(getBrowserify()) }) function getBrowserify(){ return browserify(config.files.mainJs, { cache: {}, packageCache: {}, - fullPaths: true, + plugin: [watchify], + //fullPaths: true, debug: true }) .transform('babelify', { global: true, @@ -92,6 +97,6 @@ gulp.task('watch',['js-watch'],function(){ gulp.watch(config.files.css,['css']) }) -gulp.task('serve', [ 'html', 'css', 'js', 'watch', 'server' ]) +gulp.task('serve', [ 'html', 'css', 'watch', 'server' ]) gulp.task('default', [ 'html', 'css', 'js' ]) diff --git a/package.json b/package.json index 8320e6d..2aab860 100644 --- a/package.json +++ b/package.json @@ -34,6 +34,7 @@ "gulp-connect": "^2.2.0", "gulp-minify-css": "^1.2.1", "gulp-uglify": "^1.5.1", + "gulp-util": "^3.0.7", "history": "^1.13.1", "ipfs-api": "^2.6.2", "moment": "^2.10.6",