Replies: 1 comment 2 replies
-
Unfortunately, it is how vite is meant to work. HMR only works when jsx is in within the file named You can see the related answers here #3112 (comment). |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Describe the bug
I'm trying to upgrade my react app with vite and I did most of the necessary parts. Now I'm facing a problem related to HMR.
I have a lots of .js file and I don't want to rename all of them to .jsx (.jsx works just fine with HMR). Here's my vite config.
I've the loader as
tsx
because I have some type declaration in my .js file. With this setup, my app running in the development server perfectly but whenever I'm chaning my .js file, it shows page reload instead of HMR.It's working with webpack5 and react-scripts5. Is there any way I can achieve hot refresh in my js file ?
Reproduction
no-link
Steps to reproduce
System Info
Used Package Manager
yarn
Logs
No response
Validations
Beta Was this translation helpful? Give feedback.
All reactions