今天打包vscode插件的时候,遇到了一个问题
ERROR Couldn't detect the repository where this extension is published. The image './pic/result.gif' will be broken in README.md. GitHub/GitLab repositories will be automatically detected. Otherwise, please provide the repository URL in package.json or use the --baseContentUrl and --baseImagesUrl options.
也就是这个样子
github上也有人讨论。
https://github.com/microsoft/vscode-vsce/issues/390
对此,我觉得,原因就是vscode插件,一般在vscode扩展中搜到,其介绍内容,就是README.md的内容,如果里面有视频、图片,他也会尝试去加载。但是他不允许你用本地连接,需要你用网址链接。
因此:
大致的解决方案就是,将你README.md的所有图片,gif,视频,都变成链接。
比如
演示视频如下:
<div align=center>
<img src="https://github.com/Knighthood2001/ROS-Quick-Runner/blob/main/pic/result.gif?raw=true" >
</div>
<div align=center>
<img src="https://github.com/Knighthood2001/ROS-Quick-Runner/blob/main/icon/ROS-Quick-Runner.ico" alt="插件logo" width="20%" height="20%">
</div>

以上内容,我都通过github链接代替本地的内容。
这样就能够打包和发布了。