I'm developing a node module and an example application along with it. I'm trying to add debugging breakpoints to one of the source files in the module but I can not get VSC to recognize it. Using the latest versions of Typescript and VSC.
EDIT: This is supposed to be a node application, no browser to worry about.
EDIT2: Here is repo with the issue repo with problem. Here is my current setup
├── dist
│ ├── index.d.ts
│ ├── index.js
│ ├── index.js.map
│ ├── main.d.ts
│ ├── main.js
│ ├── main.js.map
├── examples
│ ├── index.js
│ └── package.json
├── gulpfile.js
├── package.json
├── src
│ ├── index.ts
│ ├── main.ts
├── tsconfig.json
├── tslint.json
I'm developing the example in examples/index.js and I'm setting the breakpoints in src/main.ts
this is my VSC launch.json configuration
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch TypeScript",
"type": "node",
"request": "launch",
"program": "${workspaceRoot}/examples/index.js",
"sourceMaps": true,
"outDir": "${workspaceRoot}/src",
"args": [
"--nolazy"
]
}
]
}
my tsconfig.json
{
"compilerOptions": {
"target": "es2015",
"module": "commonjs",
"sourceMap": true,
"outDir": "dist",
"declaration": true,
"rootDir": "src"
},
"exclude": [
"node_modules",
"examples",
"dist"
]
}
my gulp task
gulp.task('default', function () {
var tsResult = tsProject.src('tsconfig.json')
.pipe(sourcemaps.init())
.pipe(ts(tsProject));
return merge([
tsResult.dts.pipe(gulp.dest('dist')),
tsResult.js
.pipe(sourcemaps.write('.', {includeContent: false, sourceRoot: 'src'}))
.pipe(gulp.dest('dist'))
]);
});
how the sourcemaps are coming put
{"version":3,"sources":["main.ts"],"names":[],"mappings":";CAAC,...CAAC","file":"main.js","sourceRoot":"src"}