简体   繁体   中英

Nodemon ts-node can't watch for JavaScript changes

This is my 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

Try the following nodemon.json :

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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