-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Open
Labels
Description
Describe the bug
I tried this config:
{
srcExclude: [
"./README.md",
"./infra/**"
],
}
But it doesn't work, I still see a web page generated at /README
and at /infra/README
. The source code of my project is here
Reproduction
git clone git@github.com:elastio/bon.git
cd bon/website
npm install
Then add the config mentioned above to .vitepress/config.mts
, and start the dev server:
npm run dev
I also tried **/README.md
and **/infra/**
, it didn't help.
Expected behavior
There should be no /README
and infra/README
pages generated.
System Info
System:
OS: Linux 5.15 Ubuntu 22.04.4 LTS 22.04.4 LTS (Jammy Jellyfish)
CPU: (16) x64 AMD Ryzen 7 3700X 8-Core Processor
Memory: 54.58 GB / 62.72 GB
Container: Yes
Shell: 5.8.1 - /usr/bin/zsh
Binaries:
Node: 20.10.0 - ~/.nvm/versions/node/v20.10.0/bin/node
npm: 10.2.3 - ~/.nvm/versions/node/v20.10.0/bin/npm
pnpm: 8.13.1 - ~/.nvm/versions/node/v20.10.0/bin/pnpm
npmPackages:
vitepress: ^1.4.1 => 1.4.1
Validations
- Check if you're on the latest VitePress version.Follow our Code of ConductRead the docs.Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.To pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item. Press space again to drop the item in its new position, or press escape to cancel.
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
brc-dd commentedon Oct 27, 2024
Seems to work fine for me:
(see no infra directory or README.html file is generated)
The other one also works:
This should also work:
Veetaha commentedon Oct 27, 2024
Indeed, I think that's an issue with
vitepress dev
then?brc-dd commentedon Oct 27, 2024
In dev, those paths won't be discovered by default, but if you access those paths, vite won't block them either.
Veetaha commentedon Oct 27, 2024
I see, so this is expected in
dev
mode? I did just manually enter the URL path. I suppose there could be a note about this quirck in the docs[-]`srcExclude` doesn't work[/-][+]`srcExclude` doesn't work with `vitepress dev`[/+]brc-dd commentedon Oct 27, 2024
You can restrict them though if you want:
Veetaha commentedon Oct 27, 2024
Yeah, I see, I just wasn't aware of how dev mode differs in this regard. Frankly, I know nothing about vite though 😅, I just tried the
srcExclude
option and thought to test it in dev mode.