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 08:16:05 -04:00
committed by GitHub
parent cadd115a55
commit 46a12fdb8a

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 {