Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,12 @@ HtmlWebpackInlineSourcePlugin.prototype.resolveSourceMaps = function (compilatio
var publicPath = out.publicPath || '';
// Prepend Webpack public URL path to source map relative path
// Calling `slash` converts Windows backslashes to forward slashes
var mapUrlCorrected = slash(path.join(publicPath, mapPathRelative));
var mapUrlCorrected;
if (publicPath.indexOf('http') === 0) {
mapUrlCorrected = publicPath + '/' + mapPathRelative
} else {
mapUrlCorrected = slash(path.join(publicPath, mapPathRelative));
}
// Regex: exact original sourcemap URL, possibly '*/' (for CSS), then EOF, ignoring whitespace
var regex = new RegExp(escapeRegex(mapUrlOriginal) + '(\\s*(?:\\*/)?\\s*$)');
// Replace sourcemap URL and (if necessary) preserve closing '*/' and whitespace
Expand Down