diff --git a/packages/nuxt/src/components/module.ts b/packages/nuxt/src/components/module.ts index a2a1d8ca7d..4c5dc50c77 100644 --- a/packages/nuxt/src/components/module.ts +++ b/packages/nuxt/src/components/module.ts @@ -21,9 +21,6 @@ function compareDirByPathLength ({ path: pathA }: { path: string }, { path: path return pathB.split(SLASH_SEPARATOR_RE).filter(Boolean).length - pathA.split(SLASH_SEPARATOR_RE).filter(Boolean).length } -const DEFAULT_COMPONENTS_DIRS_RE = /\/components(?:\/(?:global|islands))?$/ -const STARTER_DOT_RE = /^\./g - export type getComponentsT = (mode?: 'client' | 'server' | 'all') => Component[] export default defineNuxtModule({ @@ -78,6 +75,8 @@ export default defineNuxtModule({ })) } + const DEFAULT_COMPONENTS_DIRS_RE = /\/components(?:\/(?:global|islands))?$/ + const STARTER_DOT_RE = /^\./g // Resolve dirs nuxt.hook('app:resolve', async () => { // components/ dirs from all layers diff --git a/packages/nuxt/src/components/plugins/islands-transform.ts b/packages/nuxt/src/components/plugins/islands-transform.ts index a3e2aba41a..2b854b9bbc 100644 --- a/packages/nuxt/src/components/plugins/islands-transform.ts +++ b/packages/nuxt/src/components/plugins/islands-transform.ts @@ -24,20 +24,20 @@ interface ComponentChunkOptions { buildDir: string } -const SCRIPT_RE = /]*>/gi -const HAS_SLOT_OR_CLIENT_RE = /]*>|nuxt-client/ -const TEMPLATE_RE = /