1*a5fb1ba8SEvan Bacon"use strict"; 226ad19fcSEvan Bacon/** 326ad19fcSEvan Bacon * Copyright © 2022 650 Industries. 426ad19fcSEvan Bacon * 526ad19fcSEvan Bacon * This source code is licensed under the MIT license found in the 626ad19fcSEvan Bacon * LICENSE file in the root directory of this source tree. 726ad19fcSEvan Bacon */ 8*a5fb1ba8SEvan BaconObject.defineProperty(exports, "__esModule", { value: true }); 9*a5fb1ba8SEvan Baconexports.buildUrlForBundle = void 0; 10*a5fb1ba8SEvan Baconfunction buildUrlForBundle(bundlePath) { 1126ad19fcSEvan Bacon if (process.env.NODE_ENV === 'production') { 1226ad19fcSEvan Bacon if (typeof location !== 'undefined') { 1326ad19fcSEvan Bacon return joinComponents(location.origin, bundlePath); 1426ad19fcSEvan Bacon } 1526ad19fcSEvan Bacon throw new Error('Unable to determine the production URL where additional JavaScript chunks are hosted because the global "location" variable is not defined.'); 1626ad19fcSEvan Bacon } 1726ad19fcSEvan Bacon else { 1826ad19fcSEvan Bacon const getDevServer = require('../getDevServer') 1926ad19fcSEvan Bacon .default; 2026ad19fcSEvan Bacon const { url: serverUrl } = getDevServer(); 2126ad19fcSEvan Bacon return joinComponents(serverUrl, bundlePath); 2226ad19fcSEvan Bacon } 2326ad19fcSEvan Bacon} 24*a5fb1ba8SEvan Baconexports.buildUrlForBundle = buildUrlForBundle; 2526ad19fcSEvan Baconfunction joinComponents(prefix, suffix) { 2626ad19fcSEvan Bacon return prefix.replace(/\/+$/, '') + '/' + suffix.replace(/^\/+/, ''); 2726ad19fcSEvan Bacon} 2826ad19fcSEvan Bacon//# sourceMappingURL=buildUrlForBundle.native.js.map