Skip to content

Commit 58e56ed

Browse files
committed
Close package json watches in watch mode on close
1 parent d699bcd commit 58e56ed

File tree

5 files changed

+12
-16
lines changed

5 files changed

+12
-16
lines changed

src/compiler/watchPublic.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,10 @@ namespace ts {
404404
});
405405
parsedConfigs = undefined;
406406
}
407+
if (packageJsonMap) {
408+
clearMap(packageJsonMap, closeFileWatcher);
409+
packageJsonMap = undefined!;
410+
}
407411
}
408412

409413
function getCurrentBuilderProgram() {

tests/baselines/reference/tscWatch/incremental/editing-module-augmentation-watch.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,6 @@ Shape signatures in builder refreshed for::
203203
/users/username/projects/project/src/index.ts (computed .d.ts)
204204

205205
WatchedFiles::
206-
/users/username/projects/project/node_modules/classnames/package.json:
207-
{"fileName":"/users/username/projects/project/node_modules/classnames/package.json","pollingInterval":250}
208-
{"fileName":"/users/username/projects/project/node_modules/classnames/package.json","pollingInterval":250}
209206
/users/username/projects/project/tsconfig.json:
210207
{"fileName":"/users/username/projects/project/tsconfig.json","pollingInterval":250}
211208
/users/username/projects/project/src/index.ts:
@@ -216,6 +213,8 @@ WatchedFiles::
216213
{"fileName":"/users/username/projects/project/src/types/classnames.d.ts","pollingInterval":250}
217214
/a/lib/lib.d.ts:
218215
{"fileName":"/a/lib/lib.d.ts","pollingInterval":250}
216+
/users/username/projects/project/node_modules/classnames/package.json:
217+
{"fileName":"/users/username/projects/project/node_modules/classnames/package.json","pollingInterval":250}
219218

220219
FsWatches::
221220

tests/baselines/reference/tscWatch/incremental/importHelpers-backing-types-removed-watch.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,15 +122,14 @@ Shape signatures in builder refreshed for::
122122
/users/username/projects/project/index.tsx (used version)
123123

124124
WatchedFiles::
125-
/users/username/projects/project/node_modules/tslib/package.json:
126-
{"fileName":"/users/username/projects/project/node_modules/tslib/package.json","pollingInterval":250}
127-
{"fileName":"/users/username/projects/project/node_modules/tslib/package.json","pollingInterval":250}
128125
/users/username/projects/project/tsconfig.json:
129126
{"fileName":"/users/username/projects/project/tsconfig.json","pollingInterval":250}
130127
/users/username/projects/project/index.tsx:
131128
{"fileName":"/users/username/projects/project/index.tsx","pollingInterval":250}
132129
/a/lib/lib.d.ts:
133130
{"fileName":"/a/lib/lib.d.ts","pollingInterval":250}
131+
/users/username/projects/project/node_modules/tslib/package.json:
132+
{"fileName":"/users/username/projects/project/node_modules/tslib/package.json","pollingInterval":250}
134133

135134
FsWatches::
136135

tests/baselines/reference/tscWatch/incremental/jsxImportSource-backing-types-removed-watch.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -190,18 +190,16 @@ Shape signatures in builder refreshed for::
190190
/users/username/projects/project/index.tsx (computed .d.ts)
191191

192192
WatchedFiles::
193-
/users/username/projects/project/node_modules/react/jsx-runtime/package.json:
194-
{"fileName":"/users/username/projects/project/node_modules/react/jsx-runtime/package.json","pollingInterval":250}
195-
{"fileName":"/users/username/projects/project/node_modules/react/jsx-runtime/package.json","pollingInterval":250}
196-
/users/username/projects/project/node_modules/react/package.json:
197-
{"fileName":"/users/username/projects/project/node_modules/react/package.json","pollingInterval":250}
198-
{"fileName":"/users/username/projects/project/node_modules/react/package.json","pollingInterval":250}
199193
/users/username/projects/project/tsconfig.json:
200194
{"fileName":"/users/username/projects/project/tsconfig.json","pollingInterval":250}
201195
/users/username/projects/project/index.tsx:
202196
{"fileName":"/users/username/projects/project/index.tsx","pollingInterval":250}
203197
/a/lib/lib.d.ts:
204198
{"fileName":"/a/lib/lib.d.ts","pollingInterval":250}
199+
/users/username/projects/project/node_modules/react/jsx-runtime/package.json:
200+
{"fileName":"/users/username/projects/project/node_modules/react/jsx-runtime/package.json","pollingInterval":250}
201+
/users/username/projects/project/node_modules/react/package.json:
202+
{"fileName":"/users/username/projects/project/node_modules/react/package.json","pollingInterval":250}
205203

206204
FsWatches::
207205

tests/baselines/reference/tscWatch/incremental/jsxImportSource-option-changed-watch.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,10 +225,6 @@ Shape signatures in builder refreshed for::
225225
/users/username/projects/project/index.tsx (computed .d.ts)
226226

227227
WatchedFiles::
228-
/users/username/projects/project/node_modules/react/jsx-runtime/package.json:
229-
{"fileName":"/users/username/projects/project/node_modules/react/jsx-runtime/package.json","pollingInterval":250}
230-
/users/username/projects/project/node_modules/react/package.json:
231-
{"fileName":"/users/username/projects/project/node_modules/react/package.json","pollingInterval":250}
232228
/users/username/projects/project/tsconfig.json:
233229
{"fileName":"/users/username/projects/project/tsconfig.json","pollingInterval":250}
234230
/users/username/projects/project/index.tsx:

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy