-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Description
- download & install Node
npm init -y - Install TypeScript & check version
npm install --save-dev typescript
npx tsc --version - Configure tsconfig
tsconfig.json
{
"extends": "@tsconfig/node20/tsconfig.json",
"include": ["src/**/*"],
"exclude": ["node_modules"]
}
-
Inspect package version for ts setup
-
install compiler options
-
add compiler options
"compilerOptions": {
"outDir": "dist"
}
-
install types for less errors
npm install --save-dev @types/node -
test typescript compiler
createindex.tscontainingconsole.log("hello world")
runnpx tsc -
configure watcher
npm install --save-dev ts-node nodemon
nodemon.json
{
"watch": ["src"],
"ext": ".ts",
"ignore": [],
"exec": "tsc && node dist/server.js"
}
- prepare debugging
"compilerOptions": { "sourceMap": true
vscodium debug config
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug server.ts",
"type": "node",
"request": "launch",
"program": "${workspaceFolder}/src/server.ts",
"preLaunchTask": "tsc: build - tsconfig.json",
"outFiles": ["${workspaceFolder}/dist/**/*.js"]
}
]
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
setupOperational StuffOperational Stuff
Projects
Status
Done