mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-14 09:25:43 +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 = {
|
||||
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",
|
||||
|
||||
Reference in New Issue
Block a user