add some files

This commit is contained in:
Arina Yakovenko 2024-07-08 11:15:33 +02:00
parent accb3a105d
commit a367b12150
6 changed files with 31 additions and 21 deletions

View File

@ -1,6 +0,0 @@
<template>
<h1>Hello Nuxt3</h1>
</template>
<script setup lang="ts">
</script>

3
index.js Normal file
View File

@ -0,0 +1,3 @@
import MyModule from './modules/module';
export default MyModule;

23
modules/module.ts Normal file
View File

@ -0,0 +1,23 @@
// modules/my-module.ts
import {
defineNuxtModule,
createResolver,
addComponentsDir,
} from "@nuxt/kit";
export interface ModuleOptions {}
export default defineNuxtModule<ModuleOptions>({
meta: {
name: "module",
configKey: "myModule",
},
defaults: {},
setup(_options, _nuxt) {
const resolver = createResolver(import.meta.url);
addComponentsDir({
path: resolver.resolve("src/components/Ml"),
});
},
});

View File

@ -1,6 +1,6 @@
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
modules: ["@nuxtjs/tailwindcss", "@nuxtjs/color-mode"],
modules: ["@nuxtjs/tailwindcss", "@nuxtjs/color-mode", "~/modules/module"],
compatibilityDate: "2024-04-03",
devtools: { enabled: true },
colorMode: {},

View File

@ -1,15 +1,14 @@
{
"name": "nuxt3-reusable-components",
"version": "1.1.4",
"version": "1.1.7",
"private": false,
"type": "module",
"main": "module.ts",
"main": "index.js",
"scripts": {
"build": "nuxt build",
"prepack": "nuxt build",
"dev": "nuxt dev",
"generate": "nuxt generate",
"preview": "nuxt preview",
"postinstall": "nuxt prepare"
"start": "nuxt start"
},
"dependencies": {
"@heroicons/vue": "^2.1.4",

View File

@ -1,9 +0,0 @@
import { defineNuxtModule, addComponentsDir } from '@nuxt/kit'
export default defineNuxtModule({
setup(options, nuxt) {
addComponentsDir({
path: '~/components/Ml',
})
}
})