From c8138d5014e843feac81225f8e48843aebd363c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vesa=20Poikaj=C3=A4rvi?= Date: Fri, 24 Oct 2014 11:00:36 +0700 Subject: [PATCH] Pretty logging for rebundle Log the start and stop of rebundling the same way Gulp does, looks pretty. --- gulpfile.coffee | 5 +++++ package.json | 2 ++ 2 files changed, 7 insertions(+) diff --git a/gulpfile.coffee b/gulpfile.coffee index 46e7c46..95d9c82 100644 --- a/gulpfile.coffee +++ b/gulpfile.coffee @@ -12,6 +12,8 @@ uglify = require 'gulp-uglify' ecstatic = require 'ecstatic' livereload = require 'gulp-livereload' prefix = require 'gulp-autoprefixer' +chalk = require 'chalk' +prettyTime = require 'pretty-hrtime' production = process.env.NODE_ENV is 'production' @@ -105,6 +107,8 @@ gulp.task 'watch', -> fullPaths: true bundle.on 'update', -> + gutil.log "Starting '#{chalk.cyan 'rebundle'}'..." + start = process.hrtime() build = bundle.bundle() .on 'error', handleError @@ -113,6 +117,7 @@ gulp.task 'watch', -> build .pipe gulp.dest paths.scripts.destination .pipe(livereload()) + gutil.log "Finished '#{chalk.cyan 'rebundle'}' after #{chalk.magenta prettyTime process.hrtime start}" .emit 'update' diff --git a/package.json b/package.json index 9c98301..8de016e 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "bower": "~1.3.5", "browserify": "~6.1.0", "browserify-shim": "~3.8.0", + "chalk": "~0.5.1", "coffeeify": "~0.7.0", "deamdify": "^0.1.1", "debowerify": "~0.9.1", @@ -39,6 +40,7 @@ "karma-chrome-launcher": "~0.1.4", "karma-coffee-preprocessor": "~0.2.1", "karma-jasmine": "~0.2.2", + "pretty-hrtime": "~0.2.2", "vinyl-source-stream": "~1.0.0", "watchify": "~2.0.0" },