简体   繁体   English

Nodemon ts-node无法监视JavaScript更改

[英]Nodemon ts-node can't watch for JavaScript changes

This is my nodemon.json: 这是我的nodemon.json:

{
  "watch": ["src"],
  "ext": "ts",
  "ignore": ["src/**/*.spec.ts"],
  "exec": "ts-node ./src/index.ts"
}

My project has both js and ts files and I want it to watch changes in the js files as well but it only restarts when I change index.ts 我的项目同时包含js和ts文件,并且我希望它也监视js文件中的更改,但是它仅在更改index.ts时重新启动

Try the following nodemon.json : 试试下面的nodemon.json

{
  "watch": ["src"],
  "ext": "js,ts",
  "ignore": ["src/**/*.spec.ts"],
  "exec": "ts-node ./src/index.ts"
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM