Skip to content
This repository has been archived by the owner on Oct 19, 2023. It is now read-only.

Commit

Permalink
fix(sourcemaps): use absolute URL for sourceMappingURL
Browse files Browse the repository at this point in the history
This fixes and issue where relative URLS would be required and
consequently not found. For example, a page at foo/bar would require
sourcemapss at foo/sourcemaps/index.js.map. This fix addresses it in a
way that all sourceMappingURLs are set to absolute, always requiring
from root /sourcemaps
  • Loading branch information
zanona committed Nov 22, 2017
1 parent 62f3750 commit 9ef76db
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/sourcemaps.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ function generateSourceMap(fileHref, sources, files) {

function addSourceMappingURLToSource(file, source) {
const sourcemapFlag = '//# sourceMappingURL=';
let ref = `\n${sourcemapFlag}${file.vname}\n`;
let ref = `\n${sourcemapFlag}/${file.vname}\n`;
if (source.ext === 'html') {
ref = `<script>${ref}<\/script>`;
const marker = /<\/(body|html)>/;
Expand Down

0 comments on commit 9ef76db

Please sign in to comment.