diff --git a/build/lib/compilation.js b/build/lib/compilation.js index 837202d2126..61c178b392e 100644 --- a/build/lib/compilation.js +++ b/build/lib/compilation.js @@ -27,6 +27,7 @@ if (process.env['VSCODE_NO_SOURCEMAP']) { } options.rootDir = rootDir; options.sourceRoot = util.toFileUri(rootDir); +options.newLine = /\r\n/.test(fs.readFileSync(__filename, 'utf8')) ? 'CRLF' : 'LF'; function createCompile(build, emitError) { var opts = _.clone(options); opts.inlineSources = !!build; diff --git a/build/lib/compilation.ts b/build/lib/compilation.ts index 3d64fe6f885..cedcb4155b6 100644 --- a/build/lib/compilation.ts +++ b/build/lib/compilation.ts @@ -30,6 +30,7 @@ if (process.env['VSCODE_NO_SOURCEMAP']) { // To be used by developers in a hurry } options.rootDir = rootDir; options.sourceRoot = util.toFileUri(rootDir); +options.newLine = /\r\n/.test(fs.readFileSync(__filename, 'utf8')) ? 'CRLF' : 'LF'; function createCompile(build: boolean, emitError?: boolean): (token?: util.ICancellationToken) => NodeJS.ReadWriteStream { const opts = _.clone(options);