Coming from Webpack I was able to change code in the node_modules folder in order to add a console.log statement or something like this to find errors.
Sometimes I use external libraries incorrectly and it's easier to be able to alter lines/files in the node_modules folder to find out what my mistakes are.
With Vite, this is not possible. I can change whatever I want in the node_modules folder by my browser still uses the original libraries code.
Is there a way that allows me to change files so Vite will recognize the changes and use my new files?
Note: it's not about pull requests or permanent changes, it's only about an console.log(typeof X) and stuff like that for a single use.
Bascially the same question as this one Changing code in node_modules does not work in hot reload regardless of the bundler
Restart Vite dev server with the --force flag to re-bundle the deps. This has the same effect as manually deleting the node_modules/.vite directory.
See File System Cache in Dependency Pre-Bundling for more information.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With