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

Optimize watch ignore #52238

Merged
merged 1 commit into from
Jul 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/next/src/build/webpack-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,9 @@ const nodePathList = (process.env.NODE_PATH || '')

const watchOptions = Object.freeze({
aggregateTimeout: 5,
ignored: ['**/.git/**', '**/.next/**'],
ignored:
// Matches **/node_modules/**, **/.git/** and **/.next/**
/^((?:[^/]*(?:\/|$))*)(\.(git|next)|node_modules)(\/((?:[^/]*(?:\/|$))*)(?:$|\/))?/,

Choose a reason for hiding this comment

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

We have a very large .yarn/cache folder that just is there help install node_modules faster. Should that be included here?

Copy link

@alvarlagerlof alvarlagerlof Jul 5, 2023

Choose a reason for hiding this comment

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

Like this. If this is included in the watcher right now it could slow things down potentially?

image

Choose a reason for hiding this comment

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

Same setup for us, we have a huge .yarn/cache (sitting at 410M right now).

Copy link
Member Author

Choose a reason for hiding this comment

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

Explained this to Alvar already but the .yarn folder shouldn't be a problem as it's not resolving files from that directory exactly. It's resolving based on the node_modules / pnp file.

Choose a reason for hiding this comment

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

Ah, I think I misunderstood you earlier. Though it was checking in another way. All good then.

})

function isModuleCSS(module: { type: string }) {
Expand Down