From 6c125bc941f101cb3fe386abf42a7a8ece54cc25 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Mon, 25 Jul 2022 11:13:54 +0100 Subject: [PATCH] fix(nuxt): don't ignore components dirs with same prefix (#6116) --- packages/nuxt/src/components/scan.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/nuxt/src/components/scan.ts b/packages/nuxt/src/components/scan.ts index bb24943572..8cb106a57a 100644 --- a/packages/nuxt/src/components/scan.ts +++ b/packages/nuxt/src/components/scan.ts @@ -4,6 +4,7 @@ import { pascalCase, splitByCase } from 'scule' import type { Component, ComponentsDir } from '@nuxt/schema' import { isIgnored } from '@nuxt/kit' import { hyphenate } from '@vue/shared' +import { withTrailingSlash } from 'ufo' /** * Scan the components inside different components folders @@ -31,7 +32,7 @@ export async function scanComponents (dirs: ComponentsDir[], srcDir: string): Pr for (const _file of files) { const filePath = join(dir.path, _file) - if (scannedPaths.find(d => filePath.startsWith(d)) || isIgnored(filePath)) { + if (scannedPaths.find(d => filePath.startsWith(withTrailingSlash(d))) || isIgnored(filePath)) { continue }