From 8e1f72ef65f4ba1e4066cc1889d9fc053e3c45c6 Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Tue, 18 Feb 2025 12:52:46 +0800 Subject: [PATCH 1/2] feat: do not ignore `node_modules` by default, instead expose `globsExclude` option related https://github.com/slidevjs/slidev/issues/2066 --- src/core/fs/glob.ts | 2 +- src/core/options.ts | 1 + src/types.ts | 7 +++++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/core/fs/glob.ts b/src/core/fs/glob.ts index 9e0720e8..eb917792 100644 --- a/src/core/fs/glob.ts +++ b/src/core/fs/glob.ts @@ -8,7 +8,7 @@ export function searchComponents(ctx: Context) { debug(`started with: [${ctx.options.globs.join(', ')}]`) const root = ctx.root const files = globSync(ctx.options.globs, { - ignore: ['node_modules'], + ignore: ctx.options.globsExclude, onlyFiles: true, cwd: root, absolute: true, diff --git a/src/core/options.ts b/src/core/options.ts index ec2b5fb0..1c3277cd 100644 --- a/src/core/options.ts +++ b/src/core/options.ts @@ -15,6 +15,7 @@ export const defaultOptions: Omit, 'include' | 'exclude' | 'ex globalNamespaces: [], resolvers: [], + globsExclude: [], importPathTransform: v => v, diff --git a/src/types.ts b/src/types.ts index fa8058a8..4fe0adac 100644 --- a/src/types.ts +++ b/src/types.ts @@ -95,6 +95,13 @@ export interface Options { */ globs?: string | string[] + /** + * Negated glob patterns to exclude files from being detected as components. + * + * @default [] + */ + globsExclude?: string | string[] + /** * Search for subdirectories * @default true From 1d2bb38eac669905d36ed945251006482c35376c Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Tue, 18 Feb 2025 12:52:56 +0800 Subject: [PATCH 2/2] chore: release v28.2.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5baa5164..4516bb9c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "unplugin-vue-components", "type": "module", - "version": "28.1.0", + "version": "28.2.0", "packageManager": "pnpm@10.4.0", "description": "Components auto importing for Vue", "author": "antfu ",