web - the browser wont reload automatic,but will once I click somewhere,eg, the browser irself -


this weird problem, , after search, cant fix problem, first time ask on stackoverflow. gulpfile.js following...

//i want easy task,once css change,reload browser. var gulp = require('gulp'); var browsersync = require('browser-sync'); gulp.task('watch',['browsersync'], function() {       gulp.watch('src/css/*.css', browsersycn.reload);       gulp.watch('src/*.html', browsersync.reload); });  gulp.task('browsersync', function() {       browsersync({            server: {               basedir: 'src'               }         })     }); 

thank guys!

normally use:

var browsersync = require('browser-sync').create(); 

and use

browsersync.**init**({        server: {           basedir: 'src'           }     }) 

to initialize. hope helps.

edit 17 jan 2016: webstorm can seem cache change , not write file system. in case browsersync (gulp) can't see change. clicking out of webstorm or refreshing force update. seems problem.


Comments

Popular posts from this blog

c++ - llvm function pass ReplaceInstWithInst malloc -

java.lang.NoClassDefFoundError When Creating New Android Project -

Decoding a Python 2 `tempfile` with python-future -