From 5eb0e383d4910277b1c2ee265c9cb493509d2cb3 Mon Sep 17 00:00:00 2001 From: Justin Ridgewell Date: Mon, 13 Apr 2020 17:40:11 -0400 Subject: [PATCH] Allow sourcemap_url without fortesting --- build-system/compile/helpers.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/build-system/compile/helpers.js b/build-system/compile/helpers.js index 4b1b193b443c..580ac309451a 100644 --- a/build-system/compile/helpers.js +++ b/build-system/compile/helpers.js @@ -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() {