fix: islands not working with basePath (#2496)

This commit is contained in:
Marvin Hagemeister
2024-06-05 09:02:27 +02:00
committed by GitHub
parent f8b60ddd15
commit d613c6a6ba
3 changed files with 41 additions and 9 deletions
+1 -2
View File
@@ -70,7 +70,6 @@ export class RenderState {
error: Error | null = null;
// deno-lint-ignore no-explicit-any
slots: Array<{ id: number; name: string; vnode: VNode<any> } | null> = [];
basePath = ""; // FIXME
// deno-lint-ignore no-explicit-any
islandProps: any[] = [];
islands = new Set<Island>();
@@ -463,7 +462,7 @@ function FreshRuntimeScript() {
const named = island.exportName === "default"
? island.name
: `{ ${island.exportName} }`;
return `import ${named} from "${asset(chunk)}";`;
return `import ${named} from "${asset(`${basePath}${chunk}`)}";`;
}).join("");
const islandObj = "{" + islandArr.map((island) => island.name)