【问题标题】:Can't add images to a vscode Extension readme.md无法将图像添加到 vscode 扩展 readme.md
【发布时间】:2021-11-18 23:52:14
【问题描述】:

错误

每次我尝试使用 readme.md 中的图像编译扩展时,它都会返回以下错误:

> vsce 包

Executing prepublish script 'npm run vscode:prepublish'...

> waiter@0.0.1 vscode:prepublish D:\projetos\waiter
> npm run package


> waiter@0.0.1 package D:\projetos\waiter
> webpack --mode production --devtool hidden-source-map

    [webpack-cli] Compiler starting...     [webpack-cli] Compiler is using config: 'D:\projetos\waiter\webpack.config.js'
    [webpack-cli] Compiler finished
    asset extension.js 1.18 KiB [compared for emit] [minimized] (name: main) 1 related asset
    ./src/extension.ts 2.15 KiB [built] [code generated]
    external "vscode" 42 bytes [built] [code generated]
    webpack 5.62.2 compiled successfully in 1625 ms
 ERROR  Couldn't detect the repository where this extension is published. The image './readmeImages/initializing.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.

建议我使用--baseContentUrl--baseImagesUrl 运行

> vsce 包 --baseContentUrl --baseImageUrl

Executing prepublish script 'npm run vscode:prepublish'...

> waiter@0.0.1 vscode:prepublish D:\projetos\waiter
> npm run package


> waiter@0.0.1 package D:\projetos\waiter
> webpack --mode production --devtool hidden-source-map

    [webpack-cli] Compiler starting... 
    [webpack-cli] Compiler is using config: 'D:\projetos\waiter\webpack.config.js'
    [webpack-cli] Compiler finished
    asset extension.js 1.18 KiB [compared for emit] [minimized] (name: main) 1 related asset
    ./src/extension.ts 2.15 KiB [built] [code generated]
    external "vscode" 42 bytes [built] [code generated]
    webpack 5.62.2 compiled successfully in 1628 ms
 ERROR  Invalid URL: --baseImageUrl/readmeImages/initializing.gif

Readme.md

## Features

The gif can show you what I'm talking about, you just open the folder and everything is setup for your development session 

<img src="https://github.com/biel-correa/waiter/tree/master/readmeImages/initializing.gif?raw=true" alt="initializing a project">

## Requirements

The Waiter needs a JSON file so that he knows what you want, but don't worry as soon as it runs he'll ask you to create it.

<img src="https://github.com/biel-correa/waiter/blob/master/readmeImages/askingToCreate.png?raw=true" alt="how it asks to create">

view repository

【问题讨论】:

    标签: visual-studio-code vscode-extensions


    【解决方案1】:

    我必须打开 github markdown 编辑器,以便我可以拖放我想要显示的文件,当你这样做时,github 会为该文件生成一个自定义路径。

    我的链接

    https://github.com/biel-correa/waiter/tree/master/readmeImages/initializing.gif

    生成的链接

    https://user-images.githubusercontent.com/56176344/143320917-12fe3516-36af-4ec5-a073-5c2dd9abdc46.gif

    【讨论】:

      猜你喜欢
      • 2019-02-03
      • 2020-05-13
      • 2013-01-07
      • 2013-01-18
      • 2019-06-02
      • 1970-01-01
      • 2013-02-11
      • 1970-01-01
      • 2014-09-06
      相关资源
      最近更新 更多