You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
an optional source root, useful for relocating source files on a server or removing repeated values in the “sources” entry. This value is prepended to the individual entries in the “source” field.
In my workflow I'm generating a single js bundle from individual TypeScript files. Using gulp-sourcemaps I'm getting a source map for a single JS file that looks like
{"version":3,
"sources":["/src/App.ts","/src/common/Capability.ts","/src/common/controllers/AboutController.ts",
... snip approx 60 more files ...],
"file":"tsbundle.js","sourceRoot":"../.."}
The sourceRoot is being generated relative to the destPath I specified when writing out sourceMaps. The whole gulp task looks like:
gulp.task('tsc', ['template'], function () {
return tsProject.src()
.pipe(sourcemaps.init()) // This means sourcemaps will be generated
.pipe(tsProject())
.js
.pipe(sourcemaps.write('.', { destPath: 'www/js', includeContent: false }))
.pipe(gulp.dest("www/js"));
});
Important to note here is that, although the sources specified in the sourcemap look like absolute paths, once the sourceRoot is prepended (per the spec) they become relative paths.
However, remap-istanbul interprets them as absolute paths and tries to load files like C:\src\App.ts, which don't exist.
I have a fix for this and will put together a pull request shortly.
The text was updated successfully, but these errors were encountered:
From the v3 source map specification, sourceRoot is:
In my workflow I'm generating a single js bundle from individual TypeScript files. Using gulp-sourcemaps I'm getting a source map for a single JS file that looks like
The sourceRoot is being generated relative to the destPath I specified when writing out sourceMaps. The whole gulp task looks like:
Important to note here is that, although the sources specified in the sourcemap look like absolute paths, once the sourceRoot is prepended (per the spec) they become relative paths.
However, remap-istanbul interprets them as absolute paths and tries to load files like C:\src\App.ts, which don't exist.
I have a fix for this and will put together a pull request shortly.
The text was updated successfully, but these errors were encountered: