From a706a64a6d798a1a68d123111680bdaa32287daf Mon Sep 17 00:00:00 2001 From: Geoffrey Booth Date: Thu, 16 Nov 2017 13:30:40 -0800 Subject: [PATCH] Fix #4765: .map file should always have the same output base filename as the generated .js file (#4784) --- lib/coffeescript/command.js | 2 +- src/command.coffee | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/coffeescript/command.js b/lib/coffeescript/command.js index 1c75508f..10fa62f8 100644 --- a/lib/coffeescript/command.js +++ b/lib/coffeescript/command.js @@ -534,7 +534,7 @@ // same directory as the `.js` file. writeJs = function(base, sourcePath, js, jsPath, generatedSourceMap = null) { var compile, jsDir, sourceMapPath; - sourceMapPath = outputPath(sourcePath, base, ".js.map"); + sourceMapPath = `${jsPath}.map`; jsDir = path.dirname(jsPath); compile = function() { if (opts.compile) { diff --git a/src/command.coffee b/src/command.coffee index eb5d817a..41dae3f6 100644 --- a/src/command.coffee +++ b/src/command.coffee @@ -401,7 +401,7 @@ mkdirp = (dir, fn) -> # If `generatedSourceMap` is provided, this will write a `.js.map` file into the # same directory as the `.js` file. writeJs = (base, sourcePath, js, jsPath, generatedSourceMap = null) -> - sourceMapPath = outputPath sourcePath, base, ".js.map" + sourceMapPath = "#{jsPath}.map" jsDir = path.dirname jsPath compile = -> if opts.compile