diff --git a/src/compiler/sourcemap.ts b/src/compiler/sourcemap.ts index ed75cf081d9..e3aebc849b6 100644 --- a/src/compiler/sourcemap.ts +++ b/src/compiler/sourcemap.ts @@ -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 {