mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-18 07:29:16 -05:00
Use sorcery to merge sourcemaps between browserify and gulp-typescript (#9439)
* Use sorcery to merge sourcemaps between browserify and gulp-typescript * Use shorthand * Fix nit * move comments, change loop into map * Ahahaha, we should run code before pushing it * Move conditional into call
This commit is contained in:
@@ -614,7 +614,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
||||
|
||||
const sourceMappingURL = sourceMap.getSourceMappingURL();
|
||||
if (sourceMappingURL) {
|
||||
write(`//# sourceMappingURL=${sourceMappingURL}`);
|
||||
write(`//# ${"sourceMappingURL"}=${sourceMappingURL}`); // Sometimes tools can sometimes see this line as a source mapping url comment
|
||||
}
|
||||
|
||||
writeEmittedFiles(writer.getText(), jsFilePath, sourceMapFilePath, /*writeByteOrderMark*/ compilerOptions.emitBOM, sourceFiles);
|
||||
|
||||
@@ -328,7 +328,7 @@ class ProjectRunner extends RunnerBase {
|
||||
|
||||
if (Harness.Compiler.isJS(fileName)) {
|
||||
// Make sure if there is URl we have it cleaned up
|
||||
const indexOfSourceMapUrl = data.lastIndexOf("//# sourceMappingURL=");
|
||||
const indexOfSourceMapUrl = data.lastIndexOf(`//# ${"sourceMappingURL"}=`); // This line can be seen as a sourceMappingURL comment
|
||||
if (indexOfSourceMapUrl !== -1) {
|
||||
data = data.substring(0, indexOfSourceMapUrl + 21) + cleanProjectUrl(data.substring(indexOfSourceMapUrl + 21));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user