vitepress
vitepress copied to clipboard
Assets of type webp (image) are not copied by build
Describe the bug
Tried to use webp images inside src folder. It seems, that only jpg, png and gif are currently supported!
Reproduction
Just use any kind of image.webp referenced from markdown
Expected behavior
During build, referenced webp image should by copied to site asset folder the same way like png, etc.
System Info
System:
OS: macOS 15.0
CPU: (12) arm64 Apple M2 Max
Memory: 1.93 GB / 32.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.16.0 - /opt/homebrew/opt/node@20/bin/node
Yarn: 1.22.21 - /opt/homebrew/bin/yarn
npm: 10.8.1 - /opt/homebrew/opt/node@20/bin/npm
pnpm: 8.6.12 - /opt/homebrew/bin/pnpm
Browsers:
Chrome: 129.0.6668.71
Safari: 18.0
npmPackages:
vitepress: ^1.3.4 => 1.3.4
Additional context
No response
Validations
- [X] Check if you're on the latest VitePress version.
- [X] Follow our Code of Conduct
- [X] Read the docs.
- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
It's working fine for me. Please share a minimal reproducible example.
If you're referencing that image from frontmatter then you need to keep it in public directory.
Hi Divyansh,
sorry, but you are right.
I am refering the image from vue instead md in this case i missunderstood, that only md referenced images will be copied.
I will switch over using /public folder in such cases.
Sorry for that!
Best regards Holger
For vue too it should work fine without moving files to public unless you're using dynamic source.