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