Приложение Angular компилируется при сохранении благодаря автоматически сгенерированному файлу tsconfig, но я не могу понять, как сделать то же самое для сервера Node.js. Нужно ли мне изменять файл launch.json для ссылки на другой файл tsconfig.json?
Вот мой запуск. Json
{
"version": "0.2.0",
"configurations": [
{
"name": "ng serve",
"type": "chrome",
"request": "launch",
"preLaunchTask": "npm: start",
"url": "http://localhost:4200",
"webRoot": "${workspaceFolder}"
},
{
"type": "node",
"request": "launch",
"name": "Launch JS",
"program": "${workspaceFolder}/src/app/nodeapi/nodeapi.js"
}
]
}
tsconfig.json
{
"compileOnSave": true,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"module": "es2015",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"importHelpers": true,
"target": "es5",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2018",
"dom"
]
}
}
структура моего проекта:
|src
|-app
|--app.component.ts and other .TS files
|--nodeapi
|---nodeapi.js <---contains my server code
|tsconfig.json (shown above)