2
这是我nodemon.jsonNodemon不能重新加载。有什么不对的nodemon.json文件
{
"watch": ["src/**/*.ts"],
"exec": "node out/index.js"
}
我通过执行运行nodemon:
nodemon
在根目录下的NodeJS
这是输出:
% nodemon
[nodemon] 1.11.0
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: src/**/*.ts
[nodemon] starting node out/index.js
Yay! Started app!
但是,当我编辑任何ts文件src nodemon不会重新启动应用程序。
UPDATE
运行nodemon --watch src/index.ts --exec 'node out/index.js'
工程和重装上修改index.ts
但是该应用程序,以运行通配符
nodemon --watch 'src/**/*.ts' --exec 'node out/index.js'
或
nodemon --watch src --exec 'node out/index.js'
不重新加载应用程序。
您将需要一个'TS-node'包。请参阅:https://stackoverflow.com/questions/37979489/how-to-watch-and-reload-ts-node-when-typescript-file-changes/37979548 –
我已经开始与您提供的链接,但它doesn为我工作,所以我开始简化剧本,最终结束了这个剧本。但它也行不通 – VsMaX