diff --git a/plugins/2-register-components.ts b/plugins/2-register-components.ts
index de9668a..e413747 100644
--- a/plugins/2-register-components.ts
+++ b/plugins/2-register-components.ts
@@ -19,6 +19,7 @@ export default defineNitroPlugin(async () => {
const customElementsDefine = `Object.keys(registry).forEach((key) => {if(window?.hasOwnProperty("customElements"))customElements.define(key, registry[key]);})`;
+ if (!fs.existsSync("./public/.output")) fs.mkdirSync("./public/.output");
fs.writeFileSync(
"./public/.output/registry.js",
[...imports, registryObject, customElementsDefine].join(";")
diff --git a/routes/[...index].ts b/routes/[...index].ts
index 4379f72..14c9c53 100644
--- a/routes/[...index].ts
+++ b/routes/[...index].ts
@@ -10,13 +10,10 @@ export default eventHandler(async (event) => {
if (!html) html = await useStorage().getItem(fallback);
if (!html) html = await useStorage().getItem(getPath("/404.html"));
- // insert registry to head
- html = html
- .toString()
- .replace(
- "",
- ''
- );
+ // temporary; use ultrahtml later
+ const registryScript =
+ '';
+ html = html.toString().replace("", registryScript + "");
return html ?? new Response("Not found", { status: 404 });
});