Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Caution: StyleFix breaks BrowserSync stream reloading #6152

Open
lastant opened this issue May 27, 2020 · 2 comments
Open

Caution: StyleFix breaks BrowserSync stream reloading #6152

lastant opened this issue May 27, 2020 · 2 comments

Comments

@lastant
Copy link

lastant commented May 27, 2020

StyleFix converts <link ... /> into <style ... /> , and this breaks BrowserSync automatic style refresh. As a result, BrowserSync stylesheet reloading doesn't work, one needs to fully reload the page.
This is probably a wont-fix, but still good to know for some people.

@LeaVerou
Copy link
Owner

Yeah, I can’t think of a way around this. I guess it could be possible to retain compatibility if we kept the original link around as well but disabled it and had a mutation observer for changes to its href (if that’s how Browsersync does its refresh)?

@lastant
Copy link
Author

lastant commented May 29, 2020

I just looked a bit deeper, and seems BrowserSync does analyze <style> too, but for some reason ignores my converted styles.. Here is the code:
https://github.com/BrowserSync/browser-sync/blob/92bf7d84894e9171ed8e313909d473bbd6c7368d/packages/browser-sync-client/vendor/Reloader.ts#L392

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants