R
R
Ramil2015-07-15 11:13:02
Nginx
Ramil, 2015-07-15 11:13:02

How to make automatic page reloading via gulp?

I have a local project running in vagrant. I write styles in less and compile through gulp. Everything cool. you just have to press f5 all the time in the next window after small edits. How can I make the pages automatically update after compiling less? When I just create a layout for a new project I use www.browsersync.io it is very good at reloading pages. But how to set it up on vagrant?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
pomeo, 2015-07-15
@pomeo

var browserSync = require('browser-sync');
var reload = browserSync.reload;
gulp.task('browser-sync', function() {
  browserSync.init(null, {
    proxy: 'vagrant',
    port: 8080
  });
});
gulp.task('default', ['browser-sync'], function () {
  gulp.watch(['src/**/*.less'], reload);
});

D
Damir Aushenov, 2015-07-15
@yespeace

https://www.google.com/search?q=vagrant&oq=vagrant...
well, or as an option chrome livereload extension

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question