Browsersync + Gulp.js live reload at Intellij Idea "update resources" lag

38 views Asked by At

I use Browsersync + Gulp.js in Idea to hot reload my css styles at web page. Page reload occures properly. But resources served at exploded artifacts are overdue.

My workflow:

  • I chage change main.css in idea
  • browserSync.reload() cause reload of main.css at web page
  • but server returns old version of main.css from exploded artifacts, as resources are not updated in idea.

How to obtain updated actual resources on browserSync.reload?

gulpfile.js

var browserSync = require('browser-sync').create(),
    watchCssAndRefreshBrowser = function() {
        browserSync.init({
            proxy: "localhost:8080/"
        });
        
        return gulp.watch([
            'main.css'
        ]).on("change", function() {
            browserSync.reload('main.css');
        });
    };

gulp.task('live-reload', function(){
    watchCssAndRefreshBrowser();
});
0

There are 0 answers