Translate SystemJS bundle names before loading

We remove @scm-manager/ prefix and add append .bundle.js before loading
modules.
This commit is contained in:
Sebastian Sdorra
2020-10-13 16:38:22 +02:00
parent 17f5f4b46e
commit 22d5176d1a

View File

@@ -47,7 +47,15 @@ type PluginModule = {
const BundleLoader = {
name: "bundle-loader",
fetch: (plugin: PluginModule) => {
return fetch(plugin.address, {
let url = plugin.address;
if (!url.endsWith(".bundle.js")) {
url += ".bundle.js";
}
if (url.includes("@scm-manager/")) {
url = url.replace("@scm-manager/", "");
}
return fetch(url, {
credentials: "same-origin",
headers: {
Cache: "no-cache",