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

Commit d8c8045

Browse files
committed
fix(docz-core): add ignore md files by args
1 parent a637c10 commit d8c8045

File tree

2 files changed

+8
-13
lines changed

2 files changed

+8
-13
lines changed

packages/docz-core/src/Entries.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,6 @@ import { Plugin } from './Plugin'
1212
import { Config } from './commands/args'
1313
import { getRepoEditUrl } from './utils/repo-info'
1414

15-
const DEFAULT_IGNORE = [
16-
'readme.md',
17-
'changelog.md',
18-
'code_of_conduct.md',
19-
'contributing.md',
20-
'license.md',
21-
]
22-
23-
const ignoreFiles = (arr: string[]) =>
24-
['!**/node_modules/**'].concat(arr.length > 0 ? arr : DEFAULT_IGNORE)
25-
2615
export const fromTemplates = (file: string) => path.join(paths.templates, file)
2716

2817
const matchFilesWithSrc = (config: Config) => (files: string[]) => {
@@ -85,7 +74,7 @@ export class Entries {
8574
const toMatch = matchFilesWithSrc(config)
8675

8776
const files = await glob<string>(toMatch(arr), {
88-
ignore: ignoreFiles(ignore),
77+
ignore: ['**/node_modules/**'].concat(ignore),
8978
onlyFiles: true,
9079
unique: true,
9180
nocase: true,

packages/docz-core/src/utils/load-config.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { omit } from './helpers'
99
import { BabelRC } from './babel-config'
1010

1111
const toOmit = ['_', '$0', 'version', 'help']
12-
1312
const defaultHtmlContext = {
1413
lang: 'en',
1514
}
@@ -25,6 +24,13 @@ export const loadConfig = async (args: Config): Promise<Config> => {
2524
themeConfig: {},
2625
htmlContext: defaultHtmlContext,
2726
menu: [],
27+
ignore: [
28+
'readme.md',
29+
'changelog.md',
30+
'code_of_conduct.md',
31+
'contributing.md',
32+
'license.md',
33+
],
2834
modifyBundlerConfig: (config: any) => config,
2935
modifyBabelRc: (babelrc: BabelRC) => babelrc,
3036
}

0 commit comments

Comments
 (0)