[关闭]
@Dale-Lin 2022-09-15T19:58:49.000000Z 字数 503 阅读 331

TS Watch 配置

TypeScript


--watch 参数基于 fs.watch(目录)和 fs.watchFile(文件)实现了编译器

  1. {
  2. "compilerOptions": {
  3. "target": "es2020",
  4. "moduleResolution": "node"
  5. // ...
  6. },
  7. // options for file/directory watching
  8. "watchOptions": {
  9. "watchFile": "useFsEvents",
  10. "watchDirectory": "useFsEvents",
  11. // poll files for updates more frequently
  12. // when they're updated a lot
  13. "fallbackPolling": "dynamicPriority",
  14. // don't coalesce watch notification
  15. "synchronousWatchDirectory": true,
  16. "excludeDirectories": ["**/node_modules", "_build"],
  17. "excludeFiles": ["build/fileWhichChangesOften.ts"]
  18. }
  19. }
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注