UNPKG

nuxt-lazy-hydrate

Version:

This module is a wrapper around [Vue 3 Lazy Hydration Plugin](https://github.com/freddy38510/vue3-lazy-hydration) for Nuxt 3.

29 lines (26 loc) 696 B
import { defineNuxtModule, addComponent, addImportsSources } from '@nuxt/kit'; import * as LazyHydrationModule from 'vue3-lazy-hydration'; const module = defineNuxtModule({ meta: { name: "nuxt-lazy-hydrate", configKey: "lazyHydrate", compatibility: { nuxt: ">=3.0.0" } }, setup() { addComponent({ name: "NuxtLazyHydrate", export: "LazyHydrationWrapper", filePath: "vue3-lazy-hydration" }); const composables = Object.keys(LazyHydrationModule).filter( (key) => key !== "LazyHydrationWrapper" ); addImportsSources({ imports: composables, from: "vue3-lazy-hydration" }); } }); export { module as default };