Skip to content

Commit 2f0c432

Browse files
authored
Don't use path.join when publicPath is a URL
Fixes DustinJackson#67
1 parent e557e50 commit 2f0c432

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,12 @@ HtmlWebpackInlineSourcePlugin.prototype.resolveSourceMaps = function (compilatio
7171
var publicPath = out.publicPath || '';
7272
// Prepend Webpack public URL path to source map relative path
7373
// Calling `slash` converts Windows backslashes to forward slashes
74-
var mapUrlCorrected = slash(path.join(publicPath, mapPathRelative));
74+
var mapUrlCorrected;
75+
if (publicPath.indexOf('http') === 0) {
76+
mapUrlCorrected = publicPath + '/' + mapPathRelative
77+
} else {
78+
mapUrlCorrected = slash(path.join(publicPath, mapPathRelative));
79+
}
7580
// Regex: exact original sourcemap URL, possibly '*/' (for CSS), then EOF, ignoring whitespace
7681
var regex = new RegExp(escapeRegex(mapUrlOriginal) + '(\\s*(?:\\*/)?\\s*$)');
7782
// Replace sourcemap URL and (if necessary) preserve closing '*/' and whitespace

0 commit comments

Comments
 (0)