From 5052b252b3d9bc25dfaa6f098e5807d18a346b10 Mon Sep 17 00:00:00 2001 From: nitely Date: Sat, 15 Aug 2020 06:27:28 -0300 Subject: [PATCH] Set sourceMap file The lib vinyl-sourcemaps-apply will throw an error if file is not set --- index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index c67b7fd..5330d2a 100644 --- a/index.js +++ b/index.js @@ -36,7 +36,9 @@ module.exports = function (opt) { } if (data && data.v3SourceMap && file.sourceMap) { - applySourceMap(file, data.v3SourceMap); + var sourceMap = JSON.parse(data.v3SourceMap); + sourceMap.file = file.sourceMap.file; + applySourceMap(file, sourceMap); file.contents = Buffer.from(data.js); } else { file.contents = Buffer.from(data);