From c50e30b96ee728d11342e711850baf430f50f342 Mon Sep 17 00:00:00 2001 From: Marcus Zanona Date: Thu, 2 Nov 2017 17:47:43 -0200 Subject: [PATCH] fix(sourcemaps): failing to resolve absolute urls --- lib/sourcemaps.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/sourcemaps.js b/lib/sourcemaps.js index feab7ab..8be808d 100644 --- a/lib/sourcemaps.js +++ b/lib/sourcemaps.js @@ -6,8 +6,9 @@ function getParentDetails(js, files) { return files .filter((f) => f.type === 'html') .filter((h) => { - return h.includes && h.includes.indexOf(source) >= 0 - || h.href === source; + // remove absolute ^/ since file names come without it + const includes = (h.includes || []).map((i) => i.replace(/^\//, '')); + return includes.indexOf(source) >= 0 || h.name === source; }).map((h) => { // line and col on source mapp offset are based // on the minified/final file, not the original