Open zanona opened 9 years ago
@zanona thanks for the detail.
Yeah, the less/sass support needs a little deeper integration to fix this. It's on the list.
Hi,
We're working on an API generating dynamic CSS bundles. To define which styles to include, we use query params, like so: styles.css?components=["newsletter-subscribe"]
When BS tries to refresh, it doesn't preserve the existing query params, so it's breaking the whole flow. I could work on a PR for that, if I could only please get a tip about where to start looking?
Cheers!
@zanona
Adds rel attribute and removes all previously set URL query parameters (googleapis.com example)
this is fixed via https://github.com/BrowserSync/browser-sync-client/commit/fdc6bc6556df63749b352bdd4dbb0039cb074115 and can be installed by either
cd node_modules/browser-sync
npm i browser-sync-client@latest
or (my fav)
npm rm browser-sync && npm i browser-sync
@kosmotaur ^ this will also fix your issue
@shakyShane thanks a lot man, I will check it out. :+1:
@zanona only 1 of your 2 reported issues though, I'm afraid
Currently I have a
bs-config.js
with the following options:But the problem is that when saving a less file (styles/atf.less) on the following document:
BrowserSync not only adds a
rel
attribute to all link tags, but also removed any URL query parameters included previously (check font.googleapis.com link), generating:So I believe there are two things going wrong here:
rel
attribute to alllink
tags instead of just the ones with*.less
as established onbs-config.json
rel
attribute and removes all previously set URL query parameters (googleapis.com example)The only way I could get it to work, was to hardcode the file name under bs-config file with
this.reload('atf.less')
. Also please note that adding an Array of values such asthis.reload(['atf.less', 'main.less'])
caused BrowserSync to reload all files, including the html page.BrowserSync version tested: 2.7.12