From 00a8fc630e97f876043210f1e83b0dc4e8a68aa6 Mon Sep 17 00:00:00 2001 From: Arina Yakovenko Date: Mon, 8 Jul 2024 12:36:47 +0200 Subject: [PATCH] add some files --- modules/module.ts | 24 +++++++++++++----------- package.json | 2 +- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/modules/module.ts b/modules/module.ts index 8317739..d61c97a 100644 --- a/modules/module.ts +++ b/modules/module.ts @@ -1,12 +1,14 @@ // modules/my-module.ts -import { - defineNuxtModule, - createResolver, - addComponentsDir, -} from "@nuxt/kit"; +import { defineNuxtModule, createResolver, addComponent } from "@nuxt/kit"; export interface ModuleOptions {} +const components = [ + { + name: "MlButton", + path: "../src/components/Ml/Button/MlButton.vue", + }, +]; export default defineNuxtModule({ meta: { name: "module", @@ -16,11 +18,11 @@ export default defineNuxtModule({ setup(_options, _nuxt) { const resolver = createResolver(import.meta.url); - addComponentsDir({ - path: resolver.resolve("../src/components/Ml"), - }); - addComponentsDir({ - path: resolver.resolve("../src/composables"), - }); + for (let item of components) { + addComponent({ + name: item.name, + filePath: resolver.resolve(item.path), + }); + } }, }); diff --git a/package.json b/package.json index 643c573..cf9b1f3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nuxt3-reusable-components", - "version": "1.2.4", + "version": "1.2.5", "private": false, "type": "module", "main": "index.js",