0

gulpfile.js

var gulp = require('gulp')
var jade = require('gulp-jade')
var browserSync = require('browser-sync').create()

gulp.task('jade', function(){
  gulp.src('app/shit*/*.jade', {base: 'app'})
    .pipe(jade())
    .pipe(gulp.dest('build'))
})

gulp.task('watch', function() {
  gulp.watch('app/shit*/*.jade', ['jade'])
})

gulp.task('browser-sync', function() {
    browserSync.init({
        server: {
            baseDir: "build"
        }
    })

    gulp.watch("build/**/*.html", browserSync.reload)
    gulp.watch("build/**/*.css", browserSync.reload)
})

gulp.task('default', ['watch', 'browser-sync'])

After saving the file, Console gives «Reloading Browsers ...», but in fact the browser does not refresh.

Max Zueff
  • 191
  • 6

1 Answers1

0

When opening the app in the browser, do you see the legend "Connected to BrowserSync"? otherwise the app wont reload.

Check the deployed app and browserSync are both working in the same port (by default 3000)

Daniela
  • 318
  • 3
  • 12