As I navigate through various sources, I notice that there is a plethora of information available on older versions of VSCode (v1.16.1 - the most recent version at the time of writing) or deprecated attributes in the launch.json file.
I have experimented with different configuration attributes, referring to some outdated discussions on GitHub forums (many of which are no longer applicable due to deprecated attributes). My goal is to debug and set breakpoints directly within the Typescript code in VSCode.
Below is the contents of my tsconfig.json file:
{
"compileOnSave": false,
"compilerOptions": {
"outDir": "./dist/",
"baseUrl": "src",
"module": "commonjs",
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es5",
"typeRoots": [
"node_modules/@types"
],
"include": [
"src/**/*.ts"
],
"exclude": [
"node_modules"
],
"lib": [
"es2017",
"dom"
]
}
}
And this is how my launch.json file for Visual Studio Code looks like:
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch Chrome",
"type": "chrome",
"request": "launch",
"url": "http://localhost:3000/",
"sourceMaps": true,
"trace": true,
"webRoot": "${workspaceRoot}/src",
"userDataDir": "${workspaceRoot}/.vscode/chrome",
"sourceMapPathOverrides": {
"webpack:///src/*": "${webRoot}/*"
}
}
]
}
When I try to open Chrome, it displays the standard "...refused connection" page: https://i.stack.imgur.com/P0SMO.png
My current focus is debugging a typical "admin template". Running it through the terminal using ng serve works perfectly fine for me.
However, debugging this Angular application proves to be challenging. It's important to mention that I am fairly new to Angular, Typescript, and VSCode in general.