Skip to content

Commit

Permalink
fix: maybe fix component resolving
Browse files Browse the repository at this point in the history
  • Loading branch information
harlan-zw committed Nov 14, 2023
1 parent 1c77a6e commit 7a027d7
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions src/module.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
import { promises as fsp } from 'node:fs'
import { addComponentsDir, addPlugin, addServerPlugin, addTemplate, createResolver, defineNuxtModule } from '@nuxt/kit'
import {
addComponent,
addPlugin,
addServerPlugin,
addTemplate,
createResolver,
defineNuxtModule,
} from '@nuxt/kit'
import { template } from 'lodash-es'
import type { EventTypes, Mode } from './runtime/types'
import { extendTypes } from './kit'
Expand Down Expand Up @@ -90,10 +97,13 @@ export default defineNuxtModule<ModuleOptions>({
nuxt.options.build.transpile.push(runtimeDir)

// always add plugins
await addComponentsDir({
path: resolve('runtime/components'),
extensions: ['vue', 'ts'],
transpile: true,
await addComponent({
name: 'DelayHydration',
filePath: resolve('runtime/components/DelayHydration.ts'),
})
await addComponent({
name: 'HydrationStatus',
filePath: resolve('runtime/components/HydrationStatus.vue'),
})

if (!nuxt.options.ssr) {
Expand Down

0 comments on commit 7a027d7

Please sign in to comment.