如何通过TS和JS构建观看文件更改
我有一个带有Fastify,Apollo Server Fastify和NX的项目。我想添加一个脚本来构建我的代码并运行JS文件。问题是,如果我对TS文件进行任何更改,则无法识别重新运行JS文件。我应该怎么办? 顺便说一句,我无法将TS节点用于我的TS代码,因为我使用了自定义库,并且必须首先构建代码。
我当前的脚本:
"serve": {
"executor": "@nrwl/workspace:run-commands",
"options": {
"commands": [
"tsc -p tsconfig.app.json -w",
"tsc-alias -p tsconfig.app.json -w",
"nodemon ../../dist/apps/server/authentication/index.js"
],
"cwd": "apps/authentication",
"parallel": true
}
}
I have a project with fastify, apollo server fastify and nx. I want to add a script to build my code and run the js files. the problem is that if I make any changes in ts file it wont recognize to re run the js files. what should I do?
btw I can't use ts-node for runnig my ts code because I have used custom libraries and I have to first build my code.
my current script:
"serve": {
"executor": "@nrwl/workspace:run-commands",
"options": {
"commands": [
"tsc -p tsconfig.app.json -w",
"tsc-alias -p tsconfig.app.json -w",
"nodemon ../../dist/apps/server/authentication/index.js"
],
"cwd": "apps/authentication",
"parallel": true
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我做了一个定制执行者,希望这对其他人有帮助:
I made a custom executor, I hope this help someone else: