-
-
Notifications
You must be signed in to change notification settings - Fork 213
Description
Description
Hello! I'm using a temp folder inside node_modules that contains generated files to be used during dev time. Unfortunately the current implementation of this plugin skips over any module that has node_modules in its name, and this can't be worked around via include/exclude. Because of this the components that are generated never get wrapped with fast refresh, and thus only their very parent component has it available. Because of this when the components inside the temp folder in node_modules change, only the parent updates, but it doesn't get the latest modules since they weren't invalidated (and thus still cached).
Would you be open in a contribution changing this in some form? Happy to be guided in a path forward. Very keen to contribute and make this work.
Suggested solution
Update the code around here https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/src/index.ts#L217 so it removes the hardcoded assumption of node_modules, ideally in a backwards compatible way so as not to cause a major release (and thus friction in getting this change in).
Alternative
There isn't an alternative currently as the node_modules exclusion is hardcoded. As I want to ship a package I can't patch package my way out of this either (as that'll only fix it for myself.. but noone else using my package!) (if I want to hide the temp files).
Edit: Otherwise I can have a folder outside of node_modules, which is what I'll probably do if nothing can be done.
Additional context
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.