Skip to content

Commit

Permalink
Allow sourcemap_url without fortesting
Browse files Browse the repository at this point in the history
  • Loading branch information
jridgewell committed Apr 13, 2020
1 parent 576f9d3 commit 5eb0e38
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions build-system/compile/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,17 @@ const {VERSION: internalRuntimeVersion} = require('./internal-version');
const argv = minimist(process.argv.slice(2));

function getSourceMapBase() {
if (!argv.fortesting) {
return `https://raw.githubusercontent.com/ampproject/amphtml/${internalRuntimeVersion}/`;
} else if (argv.sourcemap_url) {
if (argv.sourcemap_url) {
// Custom sourcemap URLs have placeholder {version} that should be
// replaced with the actual version. Also, ensure trailing slash exists.
return String(argv.sourcemap_url)
.replace(/\{version\}/g, internalRuntimeVersion)
.replace(/([^/])$/, '$1/');
}
return 'http://localhost:8000/';
if (argv.fortesting) {
return 'http://localhost:8000/';
}
return `https://raw.githubusercontent.com/ampproject/amphtml/${internalRuntimeVersion}/`;
}

function writeSourcemaps() {
Expand Down

0 comments on commit 5eb0e38

Please sign in to comment.