Livereload bundle for gulp-flow.
- gulp-flow must be installed.
npm install --save-dev gulp-flow-livereload
A simple example:
gulpfile.js
let gulp = require('gulp');
let flow = require('gulp-flow');
let {cfg, gp} = flow;
// load the livereload bundle
require('gulp-flow-livereload');
// just for an example in the real word,
// load (custom) webpack bundle
require('./tasks/bundles/webpack');
gulp.task('local.build.webpack', function() {
return gulp.src(cfg.webpack.entry.main)
.pipe(gp.webpack(cfg.webpack))
.pipe(gulp.dest(cfg.publicJsDir))
.pipe(gp.livereload())
;
});
gulp.task('local.watch', function(done) {
gp.livereload.listen();
gulp.watch('./src/**/*.{js,jsx}', gulp.series('local.build.webpack'));
done();
});
Now, browser page is refreshed when the task local.build.webpack
is executed.
See gulp-livereload for more details.
MIT (c) 2016, Nicolas Tallefourtane.
Nicolas Talle |