From 8864a3cd74cf7a6bc88e4df7486d0beed3098f38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A2=E6=B5=B7=E5=AE=87?= Date: Fri, 21 Jun 2024 18:06:21 +0800 Subject: [PATCH 1/2] docs: additional notes on `globs` and `exclude` --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 09f6df5b..8b7ce49e 100644 --- a/README.md +++ b/README.md @@ -359,6 +359,7 @@ Components({ // Glob patterns to match file names to be detected as components. // When specified, the `dirs` and `extensions` options will be ignored. + // If want to exclude file in `components.d.ts`, add `!` before path like ['!path-want-exclude/*.vue'] globs: ['src/components/*.{vue}'], // search for subdirectories @@ -398,6 +399,7 @@ Components({ // filters for transforming targets include: [/\.vue$/, /\.vue\?vue/], + // If want to exclude file in `components.d.ts`, please use globs exclude: [/[\\/]node_modules[\\/]/, /[\\/]\.git[\\/]/, /[\\/]\.nuxt[\\/]/], // Vue version of project. It will detect automatically if not specified. From 82438e3ef4999d57e2f9d4260f5dd61f0b6b6113 Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Tue, 25 Jun 2024 10:25:58 +0200 Subject: [PATCH 2/2] chore: update --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8b7ce49e..298480f3 100644 --- a/README.md +++ b/README.md @@ -359,7 +359,7 @@ Components({ // Glob patterns to match file names to be detected as components. // When specified, the `dirs` and `extensions` options will be ignored. - // If want to exclude file in `components.d.ts`, add `!` before path like ['!path-want-exclude/*.vue'] + // If you want to exclude components being registered, use negative globs with leading `!`. globs: ['src/components/*.{vue}'], // search for subdirectories @@ -397,9 +397,9 @@ Components({ // Allow for components to override other components with the same name allowOverrides: false, - // filters for transforming targets + // Filters for transforming targets (components to insert the auto import) + // Note these are NOT about including/excluding components registered - use `globs` for that include: [/\.vue$/, /\.vue\?vue/], - // If want to exclude file in `components.d.ts`, please use globs exclude: [/[\\/]node_modules[\\/]/, /[\\/]\.git[\\/]/, /[\\/]\.nuxt[\\/]/], // Vue version of project. It will detect automatically if not specified.