()
| 60 | const bundler = watchify(browserify(opts)); |
| 61 | |
| 62 | function rebundle() { |
| 63 | return bundler.bundle() |
| 64 | .on('error', notify.onError()) |
| 65 | .pipe(source(paths.bundle)) |
| 66 | .pipe(buffer()) |
| 67 | .pipe(sourcemaps.init({ loadMaps: true })) |
| 68 | .pipe(sourcemaps.write('.')) |
| 69 | .pipe(gulp.dest(paths.distJs)) |
| 70 | .pipe(reload({ stream: true })); |
| 71 | } |
| 72 | |
| 73 | bundler.transform(babelify) |
| 74 | .on('update', rebundle); |