vitepress icon indicating copy to clipboard operation
vitepress copied to clipboard

Assets of type webp (image) are not copied by build

Open hschaefer123 opened this issue 1 year ago • 3 comments
trafficstars

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

hschaefer123 avatar Oct 02 '24 15:10 hschaefer123

It's working fine for me. Please share a minimal reproducible example.

image

If you're referencing that image from frontmatter then you need to keep it in public directory.

brc-dd avatar Oct 02 '24 16:10 brc-dd

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

hschaefer123 avatar Oct 02 '24 16:10 hschaefer123

For vue too it should work fine without moving files to public unless you're using dynamic source.

image

brc-dd avatar Oct 02 '24 16:10 brc-dd