mirror of
https://github.com/hanzoai/vite.git
synced 2026-10-30 19:36:16 +00:00
37 lines
1.5 KiB
Diff
37 lines
1.5 KiB
Diff
diff --git a/index.js b/index.js
|
|
index 8752893ca4986cf05103a46c438223b7ee4e1907..9185d79f6ee5194bf259dd252b8105d9846cda6c 100644
|
|
--- a/index.js
|
|
+++ b/index.js
|
|
@@ -915,6 +915,8 @@ _closePath(path) {
|
|
* @param {Path} path
|
|
*/
|
|
_closeFile(path) {
|
|
+ // normalize the key so the closer is found on removal (https://github.com/paulmillr/chokidar/pull/1467)
|
|
+ path = sysPath.normalize(path);
|
|
const closers = this._closers.get(path);
|
|
if (!closers) return;
|
|
closers.forEach(closer => closer());
|
|
@@ -928,6 +930,8 @@ _closeFile(path) {
|
|
*/
|
|
_addPathCloser(path, closer) {
|
|
if (!closer) return;
|
|
+ // normalize the key so the closer is found on removal (https://github.com/paulmillr/chokidar/pull/1467)
|
|
+ path = sysPath.normalize(path);
|
|
let list = this._closers.get(path);
|
|
if (!list) {
|
|
list = [];
|
|
diff --git a/lib/fsevents-handler.js b/lib/fsevents-handler.js
|
|
index fe29393c179d3d6673f996ca6f95bbc83f9a0699..0a341f3d6a2f1497486a23ea99b3c6da003c026f 100644
|
|
--- a/lib/fsevents-handler.js
|
|
+++ b/lib/fsevents-handler.js
|
|
@@ -305,7 +305,8 @@ _watchWithFsEvents(watchPath, realPath, transform, globFilter) {
|
|
if (this.fsw.closed || this.fsw._isIgnored(watchPath)) return;
|
|
const opts = this.fsw.options;
|
|
const watchCallback = async (fullPath, flags, info) => {
|
|
- if (this.fsw.closed) return;
|
|
+ // PATCH: bypass the callback for better perf when fullPath hit the ignored file list
|
|
+ if (this.fsw.closed || this.fsw._isIgnored(fullPath)) return;
|
|
if (
|
|
opts.depth !== undefined &&
|
|
calcDepth(fullPath, realPath) > opts.depth
|