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

+1-1
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

+1
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

+7
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)