ก็จะพยายามไม่ลืมอ่ะนะ 55555
- ใช้
yarn init -y
- ใช้
yarn add -D @types/express @types/node typescript nodemon
- ใช้
yarn add express dotenv
- ใช้
npx tsc --init
สำหรับ Setup tsconfig.json - เข้าไปเเก้ tsconfig.json ตรง
"outDir": "./dist"
เป็นตามนี้ - เเละเข้าไปเเก้ package.json ตรง script run เป็น
"scripts": { "build": "npx tsc", "start": "yarn build && node ./dist/index.js", "dev": "nodemon ./index.ts"}