mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-11 02:12:21 -05:00
Allowed to load AdminX apps from custom url
ref https://linear.app/tryghost/issue/AP-438 This is going to allow us to load the activitypub package from the jsdelivr cdn, which means we can release new versions without releasing the admin.
This commit is contained in:
parent
d9a2b0e3a6
commit
9884e2bb2c
1 changed files with 6 additions and 1 deletions
|
@ -58,7 +58,12 @@ export const importComponent = async (packageName) => {
|
|||
}
|
||||
|
||||
const baseUrl = (config.cdnUrl ? `${config.cdnUrl}assets/` : ghostPaths().assetRootWithHost);
|
||||
const url = new URL(`${baseUrl}${relativePath}/${config[`${configKey}Filename`]}?v=${config[`${configKey}Hash`]}`);
|
||||
let url = new URL(`${baseUrl}${relativePath}/${config[`${configKey}Filename`]}?v=${config[`${configKey}Hash`]}`);
|
||||
|
||||
const customUrl = config[`${configKey}CustomUrl`];
|
||||
if (customUrl) {
|
||||
url = new URL(customUrl);
|
||||
}
|
||||
|
||||
if (url.protocol === 'http:') {
|
||||
window[packageName] = await import(`http://${url.host}${url.pathname}${url.search}`);
|
||||
|
|
Loading…
Add table
Reference in a new issue