test if no copying

This commit is contained in:
Ayo 2023-10-08 09:15:10 +02:00
parent 6f7758e98f
commit 3b0f3a9a7c
3 changed files with 2 additions and 11 deletions

1
.gitignore vendored
View file

@ -5,3 +5,4 @@ node_modules
.output
.env
dist
_bkup

View file

@ -1,6 +1,7 @@
{
"private": true,
"scripts": {
"start": "nitropack dev",
"prepare": "nitropack prepare",
"dev": "nitropack dev",
"build": "nitropack build",

View file

@ -1,11 +0,0 @@
import * as fs from "fs";
export default defineNitroPlugin(async () => {
console.log("Copying components to public folder...");
const rawKeys = await useStorage().getKeys("/assets/components");
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());
});
});