Va1 / browser-sync-webpack-plugin

Easily use BrowserSync in your Webpack project.
MIT License
370 stars 40 forks source link

feat: Only trigger a reload if browser sync is not paused #92

Closed jack828 closed 2 months ago

jack828 commented 3 years ago

Hi.

Thank you for the plugin. Saved me writing my own one!

I am trying to allow a developer to toggle browser sync, and I would like to use the http protocol api.

With this fix, the plugin correctly checks whether or not browser sync has been paused and prevents triggering a reload.

It's easy to test:

fetch('http://localhost:3215/__browser_sync__?method=pause').then((res)=>console.log(res))
// make some changes...no reload event...
fetch('http://localhost:3215/__browser_sync__?method=resume').then((res)=>console.log(res))
// make some changes...reload event!