installed a plugin for Gulp Browser-Sync, set up to update the browser when I change HTML and SASS, but for some reason he writes that the page is updated, although it is not updated on the fact …
var gulp = require ('gulp'),
Mincss = Require ('Gulp-Clean-CSS'),
Sass = Require ('Gulp-Sass')
BROWSERSYNC = REQUIRE ('BROWSER-SYNC'). CREATE ();
Gulp.Task ('Mincss', Function () {
Gulp.Src ('App / CSS / *. CSS')
.pipe (mincss ())
.pipe (Gulp.dest ('General / CSS'))
});
Gulp.Task ('Sass', Function () {
Return Gulp.Src ('App / Sass / * Sass')
.pipe (sass ())
.pipe (Gulp.dest ('General / CSS'))
.pipe (BROWSERSYNC.Stream ());
});
Gulp.Task ('Server', ['sass'], function () {
BROWSERSYNC.INIT ({
Server: "App /"
});
gulp.watch ('app / sass / *. sass', ['sass']);
gulp.watch ('app / *. HTML'). ON ('Change', browsersync.reload);
});
p.s. What did I do wrong?
Answer 1, Authority 100%
You have no reboots, it does not happen to register Reload :
. Pipe (BROWSERSYNC.RELOAD ());
Answer 2
For Fresh Versions Browser-Sync We receive an error message
typeerror: cannot read property 'on' of undefined
so in the config you need to write
. Pipe (BROWSERSYNC.RELOAD ({STREAM: TRUE}));
This is a change for versions of Browser-Sync more than 2.6
or switch to the use of the new .stream () method