Pretty logging for rebundle

Log the start and stop of rebundling the same way Gulp does, looks
pretty.
This commit is contained in:
Vesa Poikajärvi
2014-10-24 11:00:36 +07:00
parent 4445fce04b
commit c8138d5014
2 changed files with 7 additions and 0 deletions

View File

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

View File

@@ -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"
},