进行更改后 ts-node-dev 不会重新启动

2023-12-19

这是我的文件:

包.json:

"scripts": {
  "generate-interfaces": "ts-node src/cli/generate-interfaces.ts",
  "dist": "npm run generate-interfaces && rm -rf dist && tsc && cp -r static/ dist/ && cp -r resource/ dist/",
  "prestart": "npm run generate-interfaces",
  "start": "ts-node-dev --respawn --transpileOnly --no-notify ./src/index.ts",
  "start:inspect": "ts-node-dev --no-deps --inspect -- ./src/index.ts",
  "pretest": "npm run generate-interfaces",
  "test": "jest"
 }

tsconfig.json

{
"compilerOptions": {
"declaration": true,
"target": "es2017",
"module": "commonjs",
"esModuleInterop": true,
"outDir": "dist",
"sourceMap": true,
"skipLibCheck": true,
"typeRoots": ["node_modules/@types", "./typings", "node_modules/**/*.d.ts"],
"lib": ["esnext"]
},
"include": ["src/**/*.ts", "./typings/**/*.d.ts"],
"exclude": ["node_modules/**", "dist"]
}

当我进行任何更改时,我会看到一个小弹出窗口,但它实际上并没有重新启动服务器,不确定我在这里做错了什么。

注意:我第一次在服务器手动重新启动后进行更改时,它会在终端中显示一个弹出窗口和类似的内容[INFO] 22:07:09 Restarting: src/analytics-engine.ts has been modified之后没有变化检测。


现在问题已经解决了。我发现问题使用--debug这是与“SIGTERM”相关的错误。所以我添加了一个标志--exit-child in my npm start script.

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

进行更改后 ts-node-dev 不会重新启动 的相关文章

随机推荐