2024-07-08 10:53:06 +00:00
|
|
|
import {
|
|
|
|
defineNuxtModule,
|
|
|
|
createResolver,
|
|
|
|
addComponent,
|
|
|
|
addImports,
|
|
|
|
} from "@nuxt/kit";
|
2024-07-08 09:15:33 +00:00
|
|
|
|
|
|
|
export interface ModuleOptions {}
|
|
|
|
|
2024-07-08 10:36:47 +00:00
|
|
|
const components = [
|
|
|
|
{
|
|
|
|
name: "MlButton",
|
2024-07-09 09:09:16 +00:00
|
|
|
path: "../components/Ml/Button/MlButton.vue",
|
2024-07-08 10:36:47 +00:00
|
|
|
},
|
2024-07-08 11:24:09 +00:00
|
|
|
{
|
|
|
|
name: "MlPaginator",
|
2024-07-09 09:09:16 +00:00
|
|
|
path: "../components/Ml/Paginator/MlPaginator.vue",
|
2024-07-08 11:24:09 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "MlDropDown",
|
2024-07-09 09:09:16 +00:00
|
|
|
path: "../components/Ml/DropDown/MlDropDown.vue",
|
2024-07-08 11:24:09 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "MlDropDownItem",
|
2024-07-09 09:09:16 +00:00
|
|
|
path: "../components/Ml/DropDown/MlDropDownItem.vue",
|
2024-07-08 11:58:03 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "MlSlider",
|
2024-07-09 09:09:16 +00:00
|
|
|
path: "../components/Ml/Slider/MlSlider.vue",
|
2024-07-08 11:58:03 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "MlSliderPoint",
|
2024-07-09 09:09:16 +00:00
|
|
|
path: "../components/Ml/SliderPoint/MlSliderPoint.vue",
|
2024-07-08 11:58:03 +00:00
|
|
|
},
|
2024-07-09 06:37:01 +00:00
|
|
|
{
|
|
|
|
name: "MlTabberBase",
|
2024-07-09 09:09:16 +00:00
|
|
|
path: "../components/Ml/Tabber/MlTabberBase.vue",
|
2024-07-09 09:00:50 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "MyComponent",
|
2024-07-09 09:09:16 +00:00
|
|
|
path: "../components/MyComponent",
|
2024-07-09 06:37:01 +00:00
|
|
|
},
|
2024-07-08 11:58:03 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
const composables = [
|
|
|
|
{
|
|
|
|
name: "useRipple",
|
2024-07-09 09:09:16 +00:00
|
|
|
path: "../composables/useRipple.ts",
|
2024-07-08 11:58:03 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "useMergeClasses",
|
2024-07-09 09:09:16 +00:00
|
|
|
path: "../composables/useMergeClasses.ts",
|
2024-07-08 11:58:03 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "useBounce",
|
2024-07-09 09:09:16 +00:00
|
|
|
path: "../composables/useBounce.ts",
|
2024-07-08 11:58:03 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "useTailwindConf",
|
2024-07-09 09:09:16 +00:00
|
|
|
path: "../composables/useTailwindConf.ts",
|
2024-07-08 11:58:03 +00:00
|
|
|
},
|
2024-07-08 10:36:47 +00:00
|
|
|
];
|
2024-07-09 09:00:50 +00:00
|
|
|
|
2024-07-08 09:15:33 +00:00
|
|
|
export default defineNuxtModule<ModuleOptions>({
|
2024-07-09 09:09:16 +00:00
|
|
|
meta: {
|
|
|
|
name: "module",
|
|
|
|
configKey: "myModule",
|
|
|
|
},
|
|
|
|
defaults: {},
|
|
|
|
setup(_options, _nuxt) {
|
|
|
|
const resolver = createResolver(import.meta.url);
|
2024-07-08 10:53:06 +00:00
|
|
|
|
2024-07-09 09:09:16 +00:00
|
|
|
for (let item of components) {
|
|
|
|
addComponent({
|
|
|
|
name: item.name,
|
|
|
|
filePath: resolver.resolve(item.path),
|
2024-07-09 09:00:50 +00:00
|
|
|
});
|
2024-07-09 09:09:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
for (let item of composables) {
|
|
|
|
addImports([
|
|
|
|
{
|
|
|
|
name: item.name,
|
|
|
|
from: resolver.resolve(item.path),
|
|
|
|
},
|
|
|
|
]);
|
|
|
|
}
|
2024-07-08 09:15:33 +00:00
|
|
|
},
|
|
|
|
});
|