I have the following code in my gulp file:
...
function styles () {
browserSync.init({
proxy: "https://localhost", //use your own server uri
port: 8000 //use your own port
});
return gulp.src(paths.scss.src)
.pipe(sourcemaps.init())
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest(paths.scss.dest))
.pipe(browserSync.stream())
}
const build = gulp.series(styles);
gulp.watch(paths.scss.watch, build);
exports.default = build
As you can see browserSync.init is being called every time styles event runs. styles runs on every change in scss files. The first time browserSync.init ran, it opened a new tab in the browser, but I expect it to do that every time styles run -- which doesn't happen, why?