So my question is, is there a way that when I run gulp watch through my terminal my browser doesn't load on a new page but instead reloads on the present page?
Asked
Active
Viewed 120 times
1 Answers
0
You can for an option use the gulp-livereload
library:
npm install --save-dev gulp-livereload
gulp-livereload
will not automatically listen for changes. You now have to manually call livereload.listen
unless you set the option start:
livereload({ start: true })
Usage
:
var gulp = require('gulp'),
less = require('gulp-less'),
livereload = require('gulp-livereload');
gulp.task('less', function() {
gulp.src('less/*.less')
.pipe(less())
.pipe(gulp.dest('css'))
.pipe(livereload());
});
gulp.task('watch', function() {
livereload.listen();
gulp.watch('less/*.less', ['less']);
});

King Reload
- 2,780
- 1
- 17
- 42
-
Thanks, i appreciate the feedback. – C. Crayton Jun 08 '17 at 04:54