[Plugins] Move to support polymanifest
This commit is contained in:
parent
57df878f65
commit
62933bc5ba
3 changed files with 19 additions and 7 deletions
|
@ -27,7 +27,8 @@ export async function fetchPlugin(url: string) {
|
|||
|
||||
// TODO: Remove duplicate error if possible
|
||||
try {
|
||||
pluginJs = await (await fetch(new URL("plugin.js", url), { cache: "no-store" })).text()
|
||||
// by polymanifest spec, plugins should always specify their main file, but just in case
|
||||
pluginJs = await (await fetch(new URL(pluginManifest.main || "index.js", url), { cache: "no-store" })).text();
|
||||
} catch {
|
||||
throw new Error(`Failed to fetch JS for ${url}`);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue