Johnathan.org

Fixing Browsersync Not Reloading

I wanted to jot this down real quick while I work on the next version of this site. I’m using Gulp and Browsersync and for the life of me I couldn’t get the reload to actually take place. Turns out I didn’t specify properly what files Browsersync needs to trigger when changed. Here’s the gulp.task() that worked for me:

gulp.task('browsersync', function (callback) {  
  browserSync.init({
    proxy: 'localhost:2368',
    files: ['app/**/*.hbs', 'app/assets/scss/**/*.scss']
    
  });

  callback();
});

Note the files: array added to the browserSync.init() function. That’s the ticket, right there. Once I did that, it was magic sauce all over again.

This entry was tagged: , ,

About the Author

A Seattle native, Johnathan has spent minutes scouring the globe for the best coffee, jerky, cheeseburgers, and whiskey. He's also writing about technology and often failing at being funny on Twitter.

Johnathan Lyman
Kenmore, WA,
United States
 
blogging, design, technology, software, development, gaming, photography