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

Hot reload, how to watch for global.css too #31

Closed
Alexn117 opened this issue Sep 23, 2020 · 1 comment · Fixed by #36
Closed

Hot reload, how to watch for global.css too #31

Alexn117 opened this issue Sep 23, 2020 · 1 comment · Fixed by #36

Comments

@Alexn117
Copy link

I'm new to webpack. I opted to use this template, instead of the default one with Rollup, because webpack comes with a proxy feature that I need for development and Rollup currently does not.

The problem is that the global.css inside the public folder does not trigger hot reload when changes are made. Making changes to the styles in .svelte files does work as expected. I tested making changes to the same global.css in the default template with Rollup and that triggers hot reload just fine. Anyone know which settings I'm supposed to add to webpack.config.js to get this to work?

@non25
Copy link
Contributor

non25 commented Jan 14, 2021

You need to set hot: true in the devServer section, and import global.css in main.js to have hot module replacement of css.
Import it like this:

import './global.css';

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

Successfully merging a pull request may close this issue.

2 participants