-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Description
Search Terms
TSC_NONPOLLING_WATCHER , nonpolling, tsconfig
Suggestion
I'd like to be able to configure tsc polling/nonpolling approach from tsconfig.json, instead of being limited to environment variables.
Acceptance Criteria
- TSC_NONPOLLING_WATCHER should be configurable from tsconfig.json
- The additional env vars introduced in Different watchFile and watchDirectory options through environment variable #21243 configurable from tsconfig.json
- environment variables override tsconfig behavior (questionable, matter of preference, maybe they should be deprecated instead over some time)
- documentation for tsconfig updated accordingly
This feature should be documented, so people know to use it, as it has true performance advantage for some scenarios, e.g.: in docker, even with delegated volumes, on macOs the tsc watcher by default eats 8-10% of CPU just watching files. With TSC_NONPOLLING_WATCHER
Use Cases
Having a central typescript-based framework, with projects based on it, we would like for the users to be able to easily override polling behavior, due to having different environment or issues arising, while retaining the ability to have non polling behavior as the default.
Examples
{
"compilerOptions": {
"watch": {
"useNonPollingWatcher": true,
"watchFile": "...",
"watchDirectory": "..."
}
}Checklist
My suggestion meets these guidelines:
- This wouldn't be a breaking change in existing TypeScript / JavaScript code
- This wouldn't change the runtime behavior of existing JavaScript code
- This could be implemented without emitting different JS based on the types of the expressions
- This isn't a runtime feature (e.g. new expression-level syntax)