How to use the watch function from browser-sync

Find comprehensive JavaScript browser-sync.watch code examples handpicked from public code repositorys.

24
25
26
27
28
29
30
31
32
33
34
module.exports = function ({ port, theme, silent, dir, resumeFilename }) {
  if (!fs.existsSync(dir)) {
    fs.mkdirSync(dir);
  }


  bs.watch(resumeFilename).on('change', () => {
    reBuildResume(theme, dir, resumeFilename, () => {
      bs.reload();
    });
  });
fork icon1
star icon0
watch icon0

+ 2 other calls in file

55
56
57
58
59
60
61
62
63
64
65
  browserSync.init({
    server: {
      baseDir: './'
    }
  });
  browserSync.watch('./', browserSync.reload);
} 


exports.styles = styles;
exports.scripts = scripts;
fork icon0
star icon0
watch icon0