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'