반응형

셋팅 순서

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 폴더 생성

 

반응형
복사했습니다!