Skip to content

Commit 9e0eca4

Browse files
committed
use bundleLogger
1 parent ea8c0da commit 9e0eca4

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

gulp/tasks/browserify.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import gulp from 'gulp';
44
import gulpif from 'gulp-if';
5-
import gutil from 'gulp-util';
65
import source from 'vinyl-source-stream';
76
import sourcemaps from 'gulp-sourcemaps';
87
import buffer from 'vinyl-buffer';
@@ -15,6 +14,7 @@ import browserSync from 'browser-sync';
1514
import debowerify from 'debowerify';
1615
import ngAnnotate from 'browserify-ngannotate';
1716
import handleErrors from '../util/handleErrors';
17+
import bundleLogger from '../util/bundleLogger';
1818
import config from '../config';
1919

2020
// Based on: http://blog.avisi.nl/2014/04/25/how-to-keep-a-fast-build-with-browserify-and-reactjs/
@@ -33,10 +33,7 @@ function buildScript(file) {
3333
if ( !global.isProd ) {
3434
bundler = watchify(bundler);
3535

36-
bundler.on('update', function() {
37-
rebundle();
38-
gutil.log('Rebundle...');
39-
});
36+
bundler.on('update', rebundle);
4037
}
4138

4239
const transforms = [
@@ -52,10 +49,14 @@ function buildScript(file) {
5249
});
5350

5451
function rebundle() {
52+
bundleLogger.start();
53+
5554
const stream = bundler.bundle();
5655
const sourceMapLocation = global.isProd ? './' : '';
5756

58-
return stream.on('error', handleErrors)
57+
return stream
58+
.on('error', handleErrors)
59+
.on('end', bundleLogger.end)
5960
.pipe(source(file))
6061
.pipe(gulpif(shouldCreateSourcemap, buffer()))
6162
.pipe(gulpif(shouldCreateSourcemap, sourcemaps.init({ loadMaps: true })))

0 commit comments

Comments
 (0)