Answer the question
In order to leave comments, you need to log in
How to overcome and run livereload in browsersync?
Hello. I have been struggling with this problem for several days now - categorically does not want to work reloading the page with gulp in the browserSync plugin. The server starts, the local version and the tunnel are working. But not an overload. I installed the connect and livereload plugins separately - everything works there, but there is no tunnel creation function in the connection, and this is quite critical.
One way to connect (now):
var gulp = require('gulp');
var browserSync = require('browser-sync').create();
var reload = browserSync.reload;
gulp.task('web', function () {
browserSync.init({
server: {
baseDir: "./build/"
}
});
gulp.watch('src/css/style.css').on("change", browserSync.reload);
});
var gulp = require('gulp');
var browserSync = require('browser-sync').create();
var reload = browserSync.reload;
gulp.task('web', function () {
browserSync.init({
server: {
baseDir: "./build"
}
});
gulp.watch('src/css/', browserSync.reload);
});
gulp.task('css', function() {
gulp.src('src/css/style.css')
.pipe(gulp.dest('build/css/'));
});
gulp.task('watch', ['css'], function(){
gulp.watch('src/css/style.css', ['css']);
});
gulp.task('default', ['web', 'css', 'watch']);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question