From 98cfe314d85b9c2a92f84416d79f95c92e8a6d9d Mon Sep 17 00:00:00 2001 From: Shulhan Date: Sun, 15 Sep 2024 13:36:40 +0700 Subject: tsconfig.json: set the watch options MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For watchFile and watchDirectory we use useFsEvents (the default): Attempt to use the operating system/file system’s native events for directory changes. dynamicPriorityPolling: Use a dynamic queue where less-frequently modified files will be checked less often. synchronousWatchDirectory: Synchronously call callbacks and update the state of directory watchers on platforms that don`t support recursive watching natively. Instead of giving a small timeout to allow for potentially multiple edits to occur on a file. Reference: https://www.typescriptlang.org/docs/handbook/configuring-watch.html --- tsconfig.json | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'tsconfig.json') diff --git a/tsconfig.json b/tsconfig.json index d7fc0f4..05e99c8 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -33,5 +33,18 @@ "vfs/example.ts", "vfs/vfs.ts", "websocket_client.ts" - ] + ], + "watchOptions": { + // Use native file system events for files and directories + "watchFile": "useFsEvents", + "watchDirectory": "useFsEvents", + // Poll files for updates more frequently + // when they're updated a lot. + "fallbackPolling": "dynamicPriority", + // Don't coalesce watch notification + "synchronousWatchDirectory": true, + // Finally, two additional settings for reducing the amount of possible + // files to track work from these directories + "excludeDirectories": ["**/node_modules"] + } } -- cgit v1.3