diff --git a/plugins/1-copy-components.ts b/plugins/1-copy-components.ts
index cec744c..cd9f804 100644
--- a/plugins/1-copy-components.ts
+++ b/plugins/1-copy-components.ts
@@ -5,7 +5,7 @@ export default defineNitroPlugin(async () => {
rawKeys.forEach(async (key) => {
const cleanKey = key.replace("assets:components:", "");
const content = await useStorage().getItem(key);
- if (!fs.existsSync("./public/output")) fs.mkdirSync("./public/output");
- fs.writeFileSync(`./public/output/${cleanKey}`, content.toString());
+ if (!fs.existsSync("./public/.output")) fs.mkdirSync("./public/.output");
+ fs.writeFileSync(`./public/.output/${cleanKey}`, content.toString());
});
});
diff --git a/plugins/2-register-components.ts b/plugins/2-register-components.ts
index 487ab86..67eccf7 100644
--- a/plugins/2-register-components.ts
+++ b/plugins/2-register-components.ts
@@ -19,11 +19,11 @@ 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");
+ if (!fs.existsSync("./public/.output")) {
+ fs.mkdirSync("./public/.output");
}
fs.writeFileSync(
- "./public/output/registry.js",
+ "./public/.output/registry.js",
[...imports, registryObject, customElementsDefine].join(";")
);
});
diff --git a/public/output/clickable-text.js b/public/output/clickable-text.js
deleted file mode 100644
index 0236936..0000000
--- a/public/output/clickable-text.js
+++ /dev/null
@@ -1,10 +0,0 @@
-import WebComponent from "https://unpkg.com/web-component-base/index.js";
-
-export default class ClickableText extends WebComponent {
- onInit() {
- this.onclick = () => alert("Thank you for clicking the text!");
- }
- get template() {
- return `Click me too!`;
- }
-}
diff --git a/public/output/hello-world.js b/public/output/hello-world.js
deleted file mode 100644
index 23b7556..0000000
--- a/public/output/hello-world.js
+++ /dev/null
@@ -1,24 +0,0 @@
-import WebComponent from "https://unpkg.com/web-component-base/index.js";
-
-export default class HelloWorld extends WebComponent {
- name = "";
- static properties = ["name"];
-
- onInit() {
- console.log(`Greeting for ${this.name} initialized`);
- let count = 0;
- this.onclick = () => {
- console.log("Clicked!");
- this.setAttribute("name", `I was clicked ${++count} times`);
- };
- this.setAttribute("title", "Click me please");
- }
-
- onChanges(changes) {
- console.log(changes);
- }
-
- get template() {
- return ``;
- }
-}
diff --git a/public/output/registry.js b/public/output/registry.js
deleted file mode 100644
index 5ec9de6..0000000
--- a/public/output/registry.js
+++ /dev/null
@@ -1,2 +0,0 @@
-import C0 from "./clickable-text.js";import C1 from "./hello-world.js";const registry = {
- "clickable-text": C0,"hello-world": C1};Object.keys(registry).forEach((key) => {if(window?.hasOwnProperty("customElements"))customElements.define(key, registry[key]);})
\ No newline at end of file
diff --git a/routes/[...index].ts b/routes/[...index].ts
index fce3126..14c9c53 100644
--- a/routes/[...index].ts
+++ b/routes/[...index].ts
@@ -12,7 +12,7 @@ export default eventHandler(async (event) => {
// temporary; use ultrahtml later
const registryScript =
- '';
+ '';
html = html.toString().replace("", registryScript + "");
return html ?? new Response("Not found", { status: 404 });