1
0
Fork 1
mirror of https://github.com/elk-zone/elk.git synced 2024-11-09 10:29:57 +00:00
elk/modules/setup-components.ts

17 lines
440 B
TypeScript
Raw Normal View History

import { defineNuxtModule, useNuxt } from '@nuxt/kit'
export default defineNuxtModule({
meta: {
name: 'setup-components',
},
setup() {
const nuxt = useNuxt()
nuxt.hook('components:extend', (components) => {
for (const component of components) {
component.pascalName = component.pascalName.replace(/Setup$/, '')
component.kebabName = component.kebabName.replace(/-setup$/, '')
}
})
},
})