From 35e24759f1e947eaed49b6ab729cdf69292549fa Mon Sep 17 00:00:00 2001 From: Oiva Eskola Date: Mon, 16 Feb 2015 22:21:51 +0200 Subject: [PATCH] fix sourcemap filenames when using transformWithDetails. Fixes #3140 --- main.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/main.js b/main.js index 8d07141039..bcea00055d 100644 --- a/main.js +++ b/main.js @@ -26,6 +26,9 @@ module.exports = { if (options && options.sourceMap) { result.sourceMap = output.sourceMap.toJSON(); } + if (options && options.sourceFilename) { + result.sourceMap.sources = [options.sourceFilename]; + } return result; } }; @@ -46,6 +49,9 @@ function innerTransform(input, options) { } var visitorList = visitors.getVisitorsBySet(visitorSets); + if (options.sourceFilename) { + options.filename = options.sourceFilename; + } return transform(visitorList, input, options); }