L
L
loki_lo2016-03-10 19:24:49
Node.js
loki_lo, 2016-03-10 19:24:49

Why won't the page refresh?

gulpfile.js code

var gulp = require('gulp');
var connect = require('gulp-connect');

// gulp.task('less' , function(){
//   	gulp.src('dist/*.less')
//   		.pipe(less())
//   		.pipe(gulp.dest('dist/style.css'))
//   		.pipe(connect.reload());
// })


gulp.task('html', function () {
   gulp.src('dist/index.html')
    .pipe(connect.reload());
});

gulp.task('connect' , function(){
  connect.server({
    root:'dist',
    livereload: true,
    port:8888
  })
})

gulp.task('watch' , function(){
  //gulp.watch('dist/*.less' , ['less']);
  gulp.watch('dist/index.html' , ['html']);
})

gulp.task('default', [ 'connect' , 'watch' , 'html' ]);

file structure
dist -> index.html
node_modules
gulpfile.js
package.json
I can't figure out why changing and saving the index file doesn't reload the page, it worked before.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
Loki_lo, 2016-03-11
@loki_lo

Found a solution
All you need to do is downgrade the gulp-connect plugin to 2.3.1
https://github.com/AveVlad/gulp-connect/issues/165

E
Evgeny Troinov, 2016-03-10
@tot0ro

While saving what?
If there are less files then you have commented out less watcher.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question