{{ loaded }} / {{ total }}
+ diff --git a/app/components/NDS.vue b/app/components/NDS.vue index 690a56b..6dc6165 100644 --- a/app/components/NDS.vue +++ b/app/components/NDS.vue @@ -1,5 +1,4 @@ -ok
- diff --git a/modules/image-assets.ts b/modules/asset-generator.ts similarity index 55% rename from modules/image-assets.ts rename to modules/asset-generator.ts index 4e7697b..7700944 100644 --- a/modules/image-assets.ts +++ b/modules/asset-generator.ts @@ -7,17 +7,19 @@ type AssetsTree = { [key: string]: string | AssetsTree; }; -const IMAGE_EXTENSIONS = new Set([".png", ".jpg", ".jpeg", ".webp", ".gif"]); +const IMAGE_EXTENSIONS = [".png", ".webp"]; +const MODELS_EXTENSIONS = [".gltf"]; +const ASSETS_EXTENSIONS = [...IMAGE_EXTENSIONS, ...MODELS_EXTENSIONS]; export default defineNuxtModule({ meta: { - name: "image-assets", - configKey: "imageAssets", + name: "asset-generator", + configKey: "assetGenerator", }, defaults: {}, async setup(_, nuxt) { - const logger = useLogger("image-assets"); - const publicImagesDir = join(nuxt.options.rootDir, "public/images"); + const logger = useLogger("asset-generator"); + const publicDir = join(nuxt.options.rootDir, "public"); const templateFile = join( nuxt.options.rootDir, "app/composables/useAssets.ts.in", @@ -27,52 +29,62 @@ export default defineNuxtModule({ "app/composables/useAssets.ts", ); - const isImageFile = (filename: string): boolean => { + const hasExt = (filename: string, exts: string[]): boolean => { const ext = parse(filename).ext.toLowerCase(); - return IMAGE_EXTENSIONS.has(ext); + return exts.includes(ext); }; const scanDirectory = async (dir: string): Promise