Closed CosmoLau closed 8 months ago
You are on Windows which is a case-insensitive FS. If it was linux you would've got broken images on dev too. Run some script to batch rename .PNG to .png.
I'm using windows 11, It has the same problem,So what should be done?
Does the jpg format also have this problem?
It's not a problem with format. It's a problem with the name. Keep them as lowercase, they will work fine.
I'm using windows 11, It has the same problem,So what should be done?
写一个脚本把所有图片的扩展名改成小写就行了,或者也可以用现成的工具,比如 renamer 包来批量修改扩展名。
如果 Markdown 里引入图片资源也是大写的,就用 VSCode 的查询替换功能,用正则表达式批量替换。
Describe the bug
我想要迁移一个 gitbook 项目到 vitepress,但是项目中有大量的部分是在 Markdown 中通过 .png 来获取 .PNG 图片的,例如一张图片名为
example.PNG
,在 Markdown 中通过以下方式调用:此时通过
vitepress dev
是可以正常显示的,没有报错。但是在通过vitepress build
进行构建时就会报错:Reproduction
.png
格式的图片到项目中,并将其扩展名修改为.PNG
![xxx](xxx.png)
的方法插入该图片vitepress build
命令进行构建Expected behavior
如果这是一个 BUG,希望能在构建时通过。如果这不是一个 BUG,那么应该在
vitepress dev
时输出报错进行提醒。System Info
Additional context
Validations