Skip to content
This repository was archived by the owner on Nov 21, 2025. It is now read-only.

Commit 5de6367

Browse files
axe312gerrakannimer
authored andcommitted
feat(docz): allow components from node_modules when explicitly requested (#1188)
1 parent f8af22b commit 5de6367

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

core/docz-core/src/lib/Entries.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,22 +48,23 @@ export class Entries {
4848

4949
private async getMap(config: Config): Promise<EntryMap> {
5050
const { paths, ignore, plugins, mdPlugins } = config
51+
const globIgnore =
52+
config.src.indexOf('node_modules') === -1 ? ['**/node_modules/**'] : []
5153
const fileMatchingPatterns = getFilesToMatch(config)
5254

5355
// Hack around fast-glob not returning the whole set when many patterns are provided in the array
5456
let initialFiles: string[] = []
5557
for (let filePattern of fileMatchingPatterns) {
5658
const filesFromPattern = await glob([filePattern], {
5759
cwd: paths.getRootDir(config),
58-
ignore: ['**/node_modules/**'],
60+
ignore: globIgnore,
5961
onlyFiles: true,
6062
unique: true,
6163
baseNameMatch: false,
6264
caseSensitiveMatch: false,
6365
})
6466
initialFiles = [...initialFiles, ...filesFromPattern]
6567
}
66-
6768
const files = initialFiles.filter((value: string) => {
6869
return !ignore.some(pattern => {
6970
if (isString(pattern)) return minimatch(value, pattern)

0 commit comments

Comments
 (0)