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

[WIP] perf: filter by ext on chokidar side #2111

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
14 changes: 0 additions & 14 deletions lib/monitor/match.js
Expand Up @@ -244,20 +244,6 @@ function match(files, monitor, ext) {

debug('good', good)

// finally check the good files against the extensions that we're monitoring
if (ext) {
if (ext.indexOf(',') === -1) {
ext = '**/*.' + ext;
} else {
ext = '**/*.{' + ext + '}';
}

good = good.filter(function (file) {
// only compare the filename to the extension test
return minimatch(path.basename(file), ext, minimatchOpts);
});
} // else assume *.*

var result = good.concat(whitelist);

if (utils.isWindows) {
Expand Down
2 changes: 2 additions & 0 deletions lib/monitor/watch.js
Expand Up @@ -52,12 +52,14 @@ function watch() {
ignored.push(dotFilePattern);
}

const ext = undefsafe(config, 'options.execOptions.ext') || '';
var watchOptions = {
ignorePermissionErrors: true,
ignored: ignored,
persistent: true,
usePolling: config.options.legacyWatch || false,
interval: config.options.pollingInterval,
ext: ext.length > 0 ? ext.split(',') : undefined,
// note to future developer: I've gone back and forth on adding `cwd`
// to the props and in some cases it fixes bugs but typically it causes
// bugs elsewhere (since nodemon is used is so many ways). the final
Expand Down