I have an Angular2 / typescript application that I am developing in VSCode. I use Gulp to create typescript files and gulp -sourcemap to create map files. Attaching / starting chrome works well after some intervention with the chrome extension for VSCode, but I cannot get breakpoints. I am launching a website using "dnx web", but I do not think this is important.
My folder structure is as follows:
project/wwwroot/index.html project/wwwroot/app/myfile.js project/wwwroot/app/myfile.js.map project/scripts/myfile.ts
My launch.json as follows:
{ "version": "0.2.0", "configurations": [ { "name": "Launch", "type": "chrome", "request": "launch", "url": "http://localhost:8001/portfolios", "runtimeArgs": [ "--new-window", //Open in new window "--user-data-dir=C:/temp/", "--remote-debugging-port=9222" ], "webRoot": "${workspaceRoot}/wwwroot", "sourceMaps": true } ] }
and my Gulp build task is as follows:
gulp.task('ts', function (done) { var files = gulp.src(tsToMove) .pipe(sourcemaps.init()) .pipe(ts(tsConfig), undefined, ts.reporter.fullReporter()); return files.js.pipe(sourcemaps.write(".",{sourceRoot: '../scripts'})) .pipe(gulp.dest('scripts')); })
I checked that map files are created and stored in the same folder as js files. during construction.
Thanks for any tips.
source share