Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix regression over injection of extensions declared under config.injectFileTypes #1488

Closed
zanona opened this issue Jan 8, 2018 · 3 comments

Comments

@zanona
Copy link

zanona commented Jan 8, 2018

Apparently, with the resolution of #10 we had a regression preventing file extensions declared under config.injectFileTypes: ['css', 'less'] to be respected once updated where a hard reload is performed instead and only applied correctly for .css files

if (options.liveCSS) {
if (path.match(/\.css$/i)) {
if (this.reloadStylesheet(path)) { return; }
}
}

@shakyShane
Copy link
Contributor

thanks @zanona - this will be addressed shortly

@shakyShane
Copy link
Contributor

@zanona can you give browser-sync@2.23.4 a try and let me know how it goes :)

@zanona
Copy link
Author

zanona commented Jan 10, 2018

Hey @shakyShane, thanks for sorting that out.
There's just one pet peeve of mine that this changes brings as opposed to something I did locally to quickly path the issue which what simply add the less extension to css like:

if (options.liveCSS) { 
     if (path.match(/\.(css|less)$/i)) { 
         if (this.reloadStylesheet(path)) { return; } 
     } 
 } 

Which is that the current fix on 2.23.4 flashes the page (as if it was removing all the styles and re-applying) every time a less file is saved but with the workaround above that transition is very smooth where you see updates only when saving without any FOUC.

If you compare between 2.23.4 and the quick fix above you will probably be able to see that :)

I hope this helps. All the best

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

No branches or pull requests

2 participants