2024-01-20 20:43:11 +00:00
|
|
|
import { addComponent, createResolver, defineNuxtModule } from 'nuxt/kit'
|
|
|
|
|
|
|
|
export default defineNuxtModule({
|
|
|
|
meta: {
|
|
|
|
name: 'import-components'
|
|
|
|
},
|
|
|
|
setup () {
|
|
|
|
const { resolve } = createResolver(import.meta.url)
|
|
|
|
|
|
|
|
addComponent({
|
|
|
|
name: 'DCompClient',
|
|
|
|
filePath: resolve('./runtime/components'),
|
2024-03-09 06:48:15 +00:00
|
|
|
mode: 'client'
|
2024-01-20 20:43:11 +00:00
|
|
|
})
|
|
|
|
|
|
|
|
addComponent({
|
|
|
|
name: 'DCompServer',
|
|
|
|
filePath: resolve('./runtime/components'),
|
2024-03-09 06:48:15 +00:00
|
|
|
mode: 'server'
|
2024-01-20 20:43:11 +00:00
|
|
|
})
|
|
|
|
|
|
|
|
addComponent({
|
|
|
|
name: 'DCompAll',
|
|
|
|
filePath: resolve('./runtime/components'),
|
2024-03-09 06:48:15 +00:00
|
|
|
mode: 'all'
|
2024-01-20 20:43:11 +00:00
|
|
|
})
|
|
|
|
|
|
|
|
addComponent({
|
|
|
|
name: 'NCompClient',
|
|
|
|
export: 'NComp',
|
|
|
|
filePath: resolve('./runtime/components'),
|
2024-03-09 06:48:15 +00:00
|
|
|
mode: 'client'
|
2024-01-20 20:43:11 +00:00
|
|
|
})
|
|
|
|
|
|
|
|
addComponent({
|
|
|
|
name: 'NCompServer',
|
|
|
|
export: 'NComp',
|
|
|
|
filePath: resolve('./runtime/components'),
|
2024-03-09 06:48:15 +00:00
|
|
|
mode: 'server'
|
2024-01-20 20:43:11 +00:00
|
|
|
})
|
|
|
|
|
|
|
|
addComponent({
|
|
|
|
name: 'NCompAll',
|
|
|
|
export: 'NComp',
|
|
|
|
filePath: resolve('./runtime/components'),
|
2024-03-09 06:48:15 +00:00
|
|
|
mode: 'all'
|
2024-01-20 20:43:11 +00:00
|
|
|
})
|
2024-03-09 06:48:15 +00:00
|
|
|
}
|
2024-01-20 20:43:11 +00:00
|
|
|
})
|