-
Notifications
You must be signed in to change notification settings - Fork 18
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
Slow Hot Reload Times In Vite #5
Comments
Hey, macaron shouldn't be affecting your HMR times this much unless its also evaluating the code that is not required. One of the ways I've encountered this is when using barrel exports and imports, i.e. export * in a file and then importing that file and using it's exports inside style declarations. If this doesn't fix your issue I'll be happy to look at a reproduction if that's something that's possible. |
@Mokshit06 Hey thanks for the tip. I think it's most definitely evaluating code that is not required. I currently have a UI folder that exports a lot of components that I import in other components in my React App. Each time a component my app begins to HMR for an abnormal amount of time. I'll take your advice and remove barrel imports inside other style declarations. If the issue persists I'll send a reproduction. Many thanks for responding |
@Mokshit06 I can confirm it was the barrel imports! It's nice blazingly fast again 🎉 |
Hey, thanks for making the library.
I've been using Macaron plugin with Vite in a medium size TS Monorepo project with a React Project. After introducing the plugin library to Vite project I've noticed my hot reload times have increased substantially to 30-60 secs.
These hot reload times are bigger than when I used library such as Chakra UI with Vite in the past. To be truthful, I'm no expert in debugging hot reload speed problem but from what I can see in my network tab, the lag in web-page rendering is when the macaron plugin transpiles code.
Packages
My current Vite config
Can you offer any tips or suggestions to get the hot reload times down?
The text was updated successfully, but these errors were encountered: