Skip to content

Commit 46a12fd

Browse files
fix(sourcemap): accept a sourceMappingURL that ends with a newline (microsoft#45983)
* fix(sourcemap): accept a sourceMappingURL that ends with a newline * Update src/compiler/sourcemap.ts Co-authored-by: Wesley Wigham <[email protected]>
1 parent cadd115 commit 46a12fd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/compiler/sourcemap.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,8 @@ namespace ts {
322322
}
323323

324324
// Sometimes tools can see the following line as a source mapping url comment, so we mangle it a bit (the [M])
325-
const sourceMapCommentRegExp = /^\/\/[@#] source[M]appingURL=(.+)$/;
325+
const sourceMapCommentRegExp = /^\/\/[@#] source[M]appingURL=(.+)\r?\n?$/;
326+
326327
const whitespaceOrMapCommentRegExp = /^\s*(\/\/[@#] .*)?$/;
327328

328329
export interface LineInfo {

0 commit comments

Comments
 (0)