在一个简单的brunch项目中,我尝试使用browsersync和autoreload来自动更新浏览器。
对javascript和css的编辑会立即更新,但在更新jade模板时,浏览器会执行重新加载,但我必须再次保存或手动重新加载浏览器以查看更改。
这很奇怪,因为根据调试输出,它似乎会进行两次重新加载,并在第二次重新加载之前复制html。
更改为玉石模板并保存:
brunch:file-list Reading 'app/index.jade' +7s
brunch:watch File 'app/index.jade' received event 'change' +0ms
brunch:pipeline Compiling 'app/index.jade' with 'JadeCompiler' +0ms
brunch:pipeline getDependencies 'app/index.jade' with 'JadeCompiler' +2ms
brunch:file-list Compiled file 'app/index.jade'... +1ms
brunch:write Writing 1/4 files +65ms
brunch:generate Concatenating app/index.jade, app/js/app.js to public/app.js +0ms
brunch:common Writing file 'public/app.js' +1ms
23 Feb 16:11:04 - info: compiled index.jade and 1 cached file into app.js in 70ms
[BS] Reloading Browsers...
brunch:watch File 'app/assets/index.html' received event 'change' +32ms
brunch:file-list Copied asset 'app/assets/index.html' +1ms
brunch:file-list Copied asset 'app/assets/index.html' +0ms
brunch:write Writing 0/4 files +67ms
23 Feb 16:11:04 - info: copied index.html in 69ms
[BS] Reloading Browsers...