-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
How do I disable the hot reload feature ? (Ideally disable it only when I change css ?) #2519
Comments
Hi! Sorry, but disabling refresh is not possible in the default setup.
Is there a specific problem you're working against? |
Yes I am working againts the fact that I have setup chrome to automatically save changes made in CSS directly to the file system , so that I can make the designing process a little more flexible, but now each time I make a change on CSS the whole application reloads , so Imagine me using Chrome dev tools to change my css top: attribute on an element each px that I change is one autoreload. |
@Timer CSS should be hot reloaded, isn't it? |
Its because I am not compiling the CSS, instead I insert the css file inside the public folder and then insert it on the main html page (the one that you could also import google analytics for example) if that make any sense Because that way, I get to live edit the css using dev tools, and the changes can get persisted on the disk.. |
I see. It's because CRA detected a change in the public folder for any files and reload the page for that. To support your use case we should enable source maps for imported CSS files, but it has FOUC issue #591. I have tried to hack it out here webpack-contrib/style-loader#221 but it's not accepted 😄 . So, currently, it's not supported. In the meantime, importing CSS from src will give you hot reloading (not ideal if you already accustomed to dev tool editing). Or add new env variable to disable reloading on public folder (not ideal because it adds another config to CRA) which is not accepted judging from #1428 FWIW, I think opening text editor and browser side by side is good enough to replace dev tool editing. (CRA hot reloads CSS in src and automatically vendor prefix it) so you don't depend on dev tool feature. It will make your workflow the same regardless of the browser that you are using. |
No description provided.
The text was updated successfully, but these errors were encountered: