Backend 언어 및 프레임워크/Javascript- Node, express, Nest
타입스크립트 셋팅(set-up)
도전맨
2021. 9. 29. 21:36
반응형
셋팅 순서
npm init -y <br>
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start":"node index.js",
"prestart":"tsc"
}, <br>
tocuh tsconfig.json <br>
{
"compilerOptions": {
"module":"CommonJS",
"target":"ES2015",
"sourceMap": true
},
"include":[
"index.ts"
],
"exclude":[
"node_modules"
],
}<br>
touch index.ts <br>
yarn add tsc-watch --dev<br>
"scripts": {
"start":"tsc-watch --onSuccess \" node dist/index.js\" "
},<br>
"include":[
"src/**/*"
],<br>
"compilerOptions": {
"module":"CommonJS",
"target":"ES2015",
"sourceMap": true,
"outDir": "dist"
},<br>
src 와 dist 폴더 생성
반응형