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

Refresh css styles without page reload #16

Closed
webwaldo opened this issue Jul 27, 2018 · 5 comments
Closed

Refresh css styles without page reload #16

webwaldo opened this issue Jul 27, 2018 · 5 comments

Comments

@webwaldo
Copy link

webwaldo commented Jul 27, 2018

Hey,

Loving the base-camp starter theme, have used parts of the stack before, but not all at once, so its nice to have it all combined.

Do you know any way to configure webpack/browsersync so that css styles will inject without a page refresh?

From what I understand, browsersync should just inject the new css, but because the js gets rebuilt, even on just a css change, the new js file triggers the reload.

Cheers

@suomato
Copy link
Owner

suomato commented Jul 27, 2018

Hi,

base-camp uses browser-sync-webpack-plugin and it seems that there is an option injectCss which should work as you wanted. However, I couldn't get it work and according to this issue there might be a problem with webpack 4 or mini-css-extract-plugin.

@michelmany
Copy link

michelmany commented Sep 9, 2018

Hi. Has this issue been fixed?

@suomato
Copy link
Owner

suomato commented Sep 11, 2018

Hi. Unfortunately no it doesn't. I haven't figured out solution yet.

@suomato
Copy link
Owner

suomato commented Nov 21, 2018

@webwaldo @michelmany this is finally fixed. Now CSS is injected without page reload as long as the sass changes doesn't affect on JavaScript.

@michelmany
Copy link

Thanks a lot @suomato

@suomato suomato closed this as completed Nov 22, 2018
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

3 participants