nodemon 대신 tsx 사용
If you use typescript, nodemon and ts-node for development.
You'll notice that it takes a while to recompile the code when it changes.
tsx은 esbuild을 사용하여 매우 빠르게 ⚡️ 실행되는 Typescript 실행입니다.
설치
저는 pnpm 사용을 선호하지만 npm, yarn 등을 사용할 수 있습니다.
pnpm add -D tsx
이제 nodemon과 ts-node를 제거할 수 있습니다.
pnpm remove nodemon ts-node
package.json에 스크립트
tsx watch [file/folder]
를 추가합니다.{
"name": "use-tsx",
"version": "1.0.0",
"main": "index.ts",
"scripts": {
"dev": "tsx watch src",
},
"devDependencies": {
"@types/node": "^18.7.18",
"tsx": "^3.9.0",
"typescript": "^4.8.3",
}
}
시작하자.
pnpm dev
심판:
Reference
이 문제에 관하여(nodemon 대신 tsx 사용), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://dev.to/rennycat/use-tsx-instead-of-nodemon-4lh3텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)