UNPKG

@vercube/nuxt-lazy-hydration

Version:

Optimize Vue 3 SSR with lazy hydration, delaying HTML hydration until it's needed for better performance

29 lines (25 loc) 594 B
'use strict'; var kit = require('@nuxt/kit'); var index = kit.defineNuxtModule({ meta: { name: 'nuxt-lazy-hydrate', configKey: 'lazyHydrate', compatibility: { nuxt: '>=3.0.0' } }, setup() { // Register the component globally kit.addComponent({ name: 'NuxtLazyHydrate', export: 'LazyHydration', filePath: '@vercube/vue-lazy-hydration' }); // Add the composable to the global imports kit.addImportsSources({ imports: ['useLazyHydration'], from: '@vercube/vue-lazy-hydration' }); } }); module.exports = index;