Answer the question
In order to leave comments, you need to log in
What does the line "stream: true" do?
What does , more precisely "stream: true". The Browsersync API has pro and , but I don't really understand how it works. In there is a parameter (object) transfer. It turns out an option, but I don’t understand where to read about it..pipe(browserSync.reload({stream:true}));
.reload( arg )
.stream( opts )
.reload({stream:true})
"use strict";
var gulp = require("gulp"),
sass = require("gulp-sass"),
browserSync = require("browser-sync").create();
gulp.task("sass", function() {
return gulp.src("app/sass/**/*")
.pipe(sass())
.pipe(gulp.dest("app/css"))
.pipe(browserSync.reload({stream:true}));
});
gulp.task("browser-sync", function() {
browserSync.init({
server: {
baseDir: "app"
},
notify: false
});
});
gulp.task("watch", ["sass", "browser-sync"], function() {
gulp.watch("app/sass/**/*", ["sass"]);
gulp.watch("app/*.html", browserSync.reload);
gulp.watch("app/**/*.js", browserSync.reload);
});
Answer the question
In order to leave comments, you need to log in
I don’t know where this object came from, the documentation for the reload method itself, which can be found in the sources, says the same as in the documentation on the site: https://browsersync.io/docs/api#api-reload
/**
* The `reload` method will inform all browsers about changed files and will either cause the browser to refresh, or inject the files where possible.
*
* @method reload
* @param {String|Array|Object} [arg] The file or files to be reloaded.
* @returns {*}
*/
{stream: true}
.stream( opts )
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question