Skip to content
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

fix(hmr): watch files in workspace root #16473

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/vite/src/node/server/index.ts
Expand Up @@ -456,7 +456,7 @@ export async function _createServer(
? (chokidar.watch(
// config file dependencies and env file might be outside of root
[
root,
searchForWorkspaceRoot(config.root),
...config.configFileDependencies,
...getEnvFilesForMode(config.mode, config.envDir),
Comment on lines 460 to 461
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found that pnpm test-serve /css/ passes if I comment out these lines. Maybe there's a bug here 🤔 But even with that running the whole test (pnpm test-serve) takes a long time. I guess it's because we have many files under the repository.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm worried about the performance impact of watching the whole fs root. What I'm thinking now is that we may need to be more fine-grained. Maybe we could automatically watch parent folders in a shallow way (not deep watch) of every imported file for example.
For now, I think we should revert.

],
Expand Down