Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

the presence of the node_modules directory in the parent directory disables HMR for the my-app project. #18394

Closed
yuhonyon opened this issue May 10, 2024 · 0 comments

Comments

@yuhonyon
Copy link

Thank you for the clarification. It seems like you're encountering an issue with Webpack 5's new mechanism that disables hot module replacement (HMR) when there is a node_modules directory in the project path. While you understand that this is likely for performance optimization, you believe that the optimization should target node_modules within the project rather than simply disabling HMR whenever there is a node_modules directory in the path.

Your npm package is installed globally, and the installation path is /User/xxxx/xxxx/node_modules/my-app, which contains two node_modules directories: /xxxx/node_modules/xxx/my-app/node_modules. When you make updates to files within my-app, the presence of the node_modules directory in the parent directory disables HMR for the my-app project.

You're suggesting that instead of disabling HMR based solely on the presence of any node_modules directory in the path, Webpack should perhaps focus on optimizing node_modules within the project scope.

This issue might need to be reported to the Webpack team as a feature request or a bug report, suggesting a more refined approach to HMR optimization. You could provide this context along with your explanation to ensure clarity in your bug report or feature request.

@webpack webpack locked and limited conversation to collaborators May 22, 2024
@alexander-akait alexander-akait converted this issue into discussion #18418 May 22, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant