[Plugins] Tidy import code
This commit is contained in:
parent
6e75d64c05
commit
a039d183b7
1 changed files with 3 additions and 5 deletions
|
@ -30,12 +30,10 @@ export async function fetchPlugin(id: string) {
|
||||||
try {
|
try {
|
||||||
// by polymanifest spec, plugins should always specify their main file, but just in case
|
// by polymanifest spec, plugins should always specify their main file, but just in case
|
||||||
pluginJs = await (await safeFetch(id + (pluginManifest.main || "index.js"), { cache: "no-store" })).text();
|
pluginJs = await (await safeFetch(id + (pluginManifest.main || "index.js"), { cache: "no-store" })).text();
|
||||||
} catch {
|
} catch {} // Empty catch, checked below
|
||||||
throw new Error(`Failed to fetch JS for ${id}`);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pluginJs.length === 0) throw new Error(`Failed to fetch JS for ${id}`);
|
if (!pluginJs && !existingPlugin) throw new Error(`Failed to fetch JS for ${id}`);
|
||||||
}
|
|
||||||
|
|
||||||
plugins[id] = {
|
plugins[id] = {
|
||||||
id: id,
|
id: id,
|
||||||
|
|
Loading…
Reference in a new issue