[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 {
|
||||
// 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();
|
||||
} catch {
|
||||
throw new Error(`Failed to fetch JS for ${id}`);
|
||||
} catch {} // Empty catch, checked below
|
||||
}
|
||||
|
||||
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] = {
|
||||
id: id,
|
||||
|
|
Loading…
Reference in a new issue