npm i nodemon
- JS
npm i babel
// .bebelrc
{
"presets": ["@babel/preset-env"]
}
// package.json
{
...,
"script": {
...,
"start:dev": "nodemon --exec babel-node src/index.js",
},
...
}
- TS
npm i ts-node typescript
tsconfig 파일은 취향에 맞게 설정한다.
// tsconfig.json
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"allowJs": true,
"outDir": "./dist",
"strict": true,
"moduleResolution": "node",
"baseUrl": ".",
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"typeRoots": ["./node_modules/@types","./types"],
"resolveJsonModule": true,
},
"include": [
"src/**/*"
]
}
// packge.json
{
...,
"scripts": {
...,
"start:dev": "nodemon --watch 'src/**/*.ts' --exec 'ts-node' src/index.ts"
},
...
}
'Server > NodeJS & NestJS' 카테고리의 다른 글
| Window nvm-node 설치 (0) | 2024.11.22 |
|---|---|
| NodeJS) error log 남기기 - fs (0) | 2023.06.30 |
| NodeJS) Bulk Job 만들기 - async/await & Promise (0) | 2023.06.15 |
| NodeJS) 서버에서 HTML 파일 읽기 (0) | 2023.04.03 |
| Node) google news에서 많이 사용된 단어 추출하기 (0) | 2023.03.07 |