-
-
Notifications
You must be signed in to change notification settings - Fork 434
Closed
Description
Reported by @schlaup in #8. Opening as a new issue here.
From @schlaup:
Ok, thanks, I just discovered an additional problem:
Typescript places its own "//# sourceMappingURL=SomeFile.ts" in the JavaScript output.
So the bundle.js files ends up with multiple "# sourceMappingURL" declarations. (Of course, only the last "# sourceMappingURL=bundle.js.map" is valid)
It seems that Chrome does not care, but other tools do. (For example "NPM source-map-support")
The solution is to remove the redundant and incorrect "sourceMappingURL" declaration.
I added another line:
if (options.sourceMap) { var sourceFilename = loaderUtils.getRemainingRequest(this); var current = loaderUtils.getCurrentRequest(this); sourceMap = JSON.parse(output.outputFiles[0].text); sourceMap.sources = [sourceFilename]; sourceMap.file = current; sourceMap.sourcesContent = [contents]; contents = output.outputFiles[1].text;This line here:
contents = contents.replace("# sourceMappingURL=", " "); }This solves the problem.
madelson
Metadata
Metadata
Assignees
Labels
No labels