fix: allow dynamic import to work when meteor is running with a path

When setting "useLocationOrigin: true" and also using a root url like
ROOT_URL=http://host:port/mypath , dynamic-import will ignore
"mypath" when fetching for files to be imported, resulting in a 404 for these
files.

To bypass this problem, i changed the code to prepend the "mypath" to the
module's URL, before trying to fetch it.

Related to #11105.
This commit is contained in:
Mario Jr
2021-10-14 11:13:40 -03:00
parent 40fda42e0f
commit 94ddacf836

View File

@@ -151,7 +151,7 @@ function fetchMissing(missingTree) {
var disableLocationOriginIframe = dynamicImportSettings.disableLocationOriginIframe;
if (useLocationOrigin && location && !(disableLocationOriginIframe && inIframe())) {
url = location.origin.concat(url);
url = location.origin.concat(__meteor_runtime_config__.ROOT_URL_PATH_PREFIX, url);
} else {
url = Meteor.absoluteUrl(url);
}