From 6479a919281acee145ea1ff3f53e7667c9f225d0 Mon Sep 17 00:00:00 2001 From: tbitw2549 Date: Sat, 9 Nov 2024 00:48:41 +0200 Subject: [PATCH] fix: unify component name detection --- packages/nuxt/src/components/plugins/delayed-hydration.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nuxt/src/components/plugins/delayed-hydration.ts b/packages/nuxt/src/components/plugins/delayed-hydration.ts index fa28269372..4326fa16b2 100644 --- a/packages/nuxt/src/components/plugins/delayed-hydration.ts +++ b/packages/nuxt/src/components/plugins/delayed-hydration.ts @@ -4,7 +4,7 @@ import MagicString from 'magic-string' import { isVue } from '../../core/utils' export const DelayedHydrationPlugin = (options: { sourcemap: boolean }) => createUnplugin(() => { - const DELAYED_HYDRATION_RE = /<(?:Lazy([A-Z]\w*)|lazy-([\w-]+))\b([^>]+)hydrate:(\w+)(="([^"]+)")?([ />])([^>]*(?:(?<=\/)|>[\s\S]+?<\/Lazy[A-Z]\w*|lazy-[\w-]+))>/g + const DELAYED_HYDRATION_RE = /<(?:Lazy|lazy-)([A-Z]\w*|[\w-]+)\b([^>]+)hydrate:(\w+)(="([^"]+)")?([ />])([^>]*(?:(?<=\/)|>[\s\S]+?<\/Lazy[A-Z]\w*|lazy-[\w-]+))>/g const types = new Map([['time', 'Time'], ['promise', 'Promise'], ['if', 'If'], ['event', 'Event'], ['visible', 'Visible'], ['media', 'Media'], ['never', 'Never'], ['idle', 'Idle']]) const correctVals = new Map([['time', 'number'], ['promise', 'Promise'], ['event', 'string | string[]'], ['visible', 'IntersectionObserverInit'], ['media', 'string'], ['idle', 'number']]) return {