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

HMR wont work with chunked scss #111

Closed
oskarleonard opened this issue Oct 8, 2018 · 5 comments
Closed

HMR wont work with chunked scss #111

oskarleonard opened this issue Oct 8, 2018 · 5 comments

Comments

@oskarleonard
Copy link
Contributor

  1. Check the version of package you are using. If it's not the newest version, update and try again (see changelog while updating!).
    Latest

  2. If the issue is still there, write a minimal project showing the problem and expected output.
    https://github.com/madeagency/reactivity

  3. Link to the project and mention Node version and OS in your report.
    https://github.com/madeagency/reactivity

I cannot get hmr to work with scss, only non chuncked scss (main.scss) gets hmr. My "solution" so far is to use style-loader instead of ExtractCssChunks.loader in dev but that kind of bread server styles (not looking as nice as in the universal demo)

@oskarleonard oskarleonard changed the title HMR wont work with scss HMR wont work with chunked scss Oct 8, 2018
@ScriptedAlchemy
Copy link
Collaborator

https://github.com/madeagency/reactivity/blob/108fe7a05d80f6677cc4ca854b046e0ed0180b0c/webpack/client.dev.js#L71

These settings can be tried in various orders depending on your requirements (css modules or not)

Try new ExtractCSS({hot: true, reloadAll: true, cssModules: true})

@oskarleonard
Copy link
Contributor Author

Super! :D. Had just tried hot: true, didnt know about the other options, only using reloadAll: true solved everything, works so much faster then style loader.

@ScriptedAlchemy
Copy link
Collaborator

yeah i realized today theres no documentation, writing it as we speak

@oskarleonard
Copy link
Contributor Author

oskarleonard commented Oct 8, 2018

That would be great especially documenting the API :). Maybe while you are in the process you could modify this line:
new ExtractCssChunks({hot:true}), //if you want HMR - we try to automatically inject hot reloading but if it's not working, add it to the config
to
new ExtractCssChunks({hot: true, reloadAll: true, cssModules: true}), //if you want HMR - we try to automatically inject hot reloading but if it's not working, add it to the config
Or, if you serve chunks you might need to add reloadAll: true

@ScriptedAlchemy
Copy link
Collaborator

Added some docs!

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