Johnathan.org

Johnathan.org • A technology blog produced by Johnathan Lyman covering a variety of tutorials, thoughts, and commentary on all of the technology around us.

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.

Enjoying these posts? Subscribe for more
Subscribe now

Subscribe to be notified of new content and support Johnathan.org! You'll be a part of the community and no longer see ads.

You've successfully subscribed to Johnathan.org
Great! Next, complete checkout for full access to Johnathan.org
Welcome back! You've successfully signed in
Success! Your account is fully activated, you now have access to all content.