-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Labels
buildRelated to the build systemRelated to the build system
Description
Describe the bug
我在使用 createContentLoader()
加载 Markdown 文件时,尝试通过 !**/index.md
和 !**/*-ignore.md
排除某些文件,但这些排除规则没有生效
export default createContentLoader(
[
'**/*.md',
'!**/*-ignore.md',
'!**/index.md',
],
)
直接使用 tinyglobby
是正常的
import { glob } from 'tinyglobby'
glob(
[
'**/*.md',
'!**/*-ignore.md',
'!**/index.md',
],
{ cwd: 'docs' },
).then((res) => {
console.log(res.length)
})
Reproduction
https://stackblitz.com/edit/vite-createcontentloader?file=docs%2Ftest.data.js
Expected behavior
正确的排除文件
System Info
System:
OS: Windows 11 10.0.26120
CPU: (32) x64 13th Gen Intel(R) Core(TM) i9-13980HX
Memory: 35.99 GB / 63.63 GB
Binaries:
Node: 22.14.0 - C:\Program Files\nodejs\node.EXE
npm: 10.9.2 - C:\Program Files\nodejs\npm.CMD
pnpm: 10.11.0 - ~\AppData\Local\pnpm\pnpm.EXE
Browsers:
Edge: Chromium (134.0.3124.19)
Internet Explorer: 11.0.26100.1
npmPackages:
vitepress: 2.0.0-alpha.6 => 2.0.0-alpha.6
Additional context
No response
Validations
- Check if you're on the latest VitePress version.
- Follow our Code of Conduct
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Metadata
Metadata
Assignees
Labels
buildRelated to the build systemRelated to the build system