简体   繁体   English

nodemon,ts-node,不自动重新编译

[英]nodemon, ts-node, not automatically recompiling

I am trying to create rest-api using, express+ts-node.我正在尝试使用 express+ts-node 创建rest-api。 I have done all setup based upon online tutorials, and when I run app using npm run dev it is working perfectly.我已经根据在线教程完成了所有设置,当我使用npm run dev运行应用程序时,它运行良好。 But it is not restarting OnSave.但它不会重新启动 OnSave。 This is my package.json script tag:这是我的 package.json 脚本标签:

  "scripts": {
    "dev": "npm run nodemon src/index.ts",
    "nodemon": "nodemon --watch 'src/**/*.ts' --ignore 'src/**/*.spec.ts' -r ts-node/register/transpile-only -r tsconfig-paths/register -r dotenv/config --exec ts-node --files src/index.ts",
    "swagger": "tsoa spec"
  },

Looks like nodemon not watching file changes.看起来 nodemon 没有监视文件更改。 Please help, how to do restart on save.请帮忙,如何在保存时重新启动。

try to install the ts-node-dev library then use this command in dev:尝试安装ts-node-dev库,然后在 dev 中使用此命令:

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

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