fix(sourcemap): accept a sourceMappingURL that ends with a newline (#45983)

* fix(sourcemap): accept a sourceMappingURL that ends with a newline

* Update src/compiler/sourcemap.ts

Co-authored-by: Wesley Wigham <wwigham@gmail.com>
This commit is contained in:
Joel Einbinder
2021-10-01 05:16:05 -07:00
committed by GitHub
co-authored by Wesley Wigham
parent cadd115a55
commit 46a12fdb8a
+2 -1
View File
@@ -322,7 +322,8 @@ namespace ts {
}
// Sometimes tools can see the following line as a source mapping url comment, so we mangle it a bit (the [M])
const sourceMapCommentRegExp = /^\/\/[@#] source[M]appingURL=(.+)$/;
const sourceMapCommentRegExp = /^\/\/[@#] source[M]appingURL=(.+)\r?\n?$/;
const whitespaceOrMapCommentRegExp = /^\s*(\/\/[@#] .*)?$/;
export interface LineInfo {