From 27c03203629bca45f22778177e85c2c28a0f06d0 Mon Sep 17 00:00:00 2001 From: coderluo <64744556+codelzb@users.noreply.github.com> Date: Fri, 28 Feb 2025 10:52:23 +0800 Subject: [PATCH] fix: #822 Fixed a bug that contained parentheses in the win path --- src/core/fs/glob.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/core/fs/glob.ts b/src/core/fs/glob.ts index 912d326b..0598047a 100644 --- a/src/core/fs/glob.ts +++ b/src/core/fs/glob.ts @@ -1,12 +1,17 @@ import type { Context } from '../context' import Debug from 'debug' import { globSync } from 'tinyglobby' +import { platform } from 'os' const debug = Debug('unplugin-vue-components:glob') export function searchComponents(ctx: Context) { debug(`started with: [${ctx.options.globs.join(', ')}]`) const root = ctx.root + // Fixed a bug that contained parentheses in the win path https://github.com/unplugin/unplugin-vue-components/issues/822 + if (platform() === 'win32') { + ctx.options.globs = ctx.options.globs.map((dir) => fg.convertPathToPattern(dir)) + } const files = globSync(ctx.options.globs, { ignore: ctx.options.globsExclude, onlyFiles: true,