mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-14 17:26:22 +01:00
Translate SystemJS bundle names before loading
We remove @scm-manager/ prefix and add append .bundle.js before loading modules.
This commit is contained in:
@@ -47,7 +47,15 @@ type PluginModule = {
|
|||||||
const BundleLoader = {
|
const BundleLoader = {
|
||||||
name: "bundle-loader",
|
name: "bundle-loader",
|
||||||
fetch: (plugin: PluginModule) => {
|
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",
|
credentials: "same-origin",
|
||||||
headers: {
|
headers: {
|
||||||
Cache: "no-cache",
|
Cache: "no-cache",
|
||||||
|
|||||||
Reference in New Issue
Block a user