Skip to content

Commit 8e1f72e

Browse files
committed
feat: do not ignore node_modules by default, instead expose globsExclude option
related slidevjs/slidev#2066
1 parent 0bc1b13 commit 8e1f72e

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

src/core/fs/glob.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export function searchComponents(ctx: Context) {
88
debug(`started with: [${ctx.options.globs.join(', ')}]`)
99
const root = ctx.root
1010
const files = globSync(ctx.options.globs, {
11-
ignore: ['node_modules'],
11+
ignore: ctx.options.globsExclude,
1212
onlyFiles: true,
1313
cwd: root,
1414
absolute: true,

src/core/options.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export const defaultOptions: Omit<Required<Options>, 'include' | 'exclude' | 'ex
1515
globalNamespaces: [],
1616

1717
resolvers: [],
18+
globsExclude: [],
1819

1920
importPathTransform: v => v,
2021

src/types.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,13 @@ export interface Options {
9595
*/
9696
globs?: string | string[]
9797

98+
/**
99+
* Negated glob patterns to exclude files from being detected as components.
100+
*
101+
* @default []
102+
*/
103+
globsExclude?: string | string[]
104+
98105
/**
99106
* Search for subdirectories
100107
* @default true

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy