Skip to content

fix: 兼容 publicPath 为绝对路径的 url 的情况#27

Merged
levy9527 merged 2 commits intoFEMessage:devfrom
gd4Ark:fix/correct-path
Oct 20, 2020
Merged

fix: 兼容 publicPath 为绝对路径的 url 的情况#27
levy9527 merged 2 commits intoFEMessage:devfrom
gd4Ark:fix/correct-path

Conversation

@gd4Ark
Copy link
Copy Markdown
Member

@gd4Ark gd4Ark commented Oct 19, 2020

Why

以前的写法只支持传入相对路径的 publicPath,因为是使用 path.join() 进行拼接,所以传入带协议的 url,就会被转换为路径

How

在原有的基础上,判断 publicPath 是否一个 绝对路径的 url(http 或者 // 开头

如果是,则使用 url.resolve() 拼接 url

Test

image

@auto-add-label auto-add-label bot added the bug Something isn't working label Oct 19, 2020
@levy9527 levy9527 merged commit 5320a20 into FEMessage:dev Oct 20, 2020
@levy9527
Copy link
Copy Markdown
Contributor

@all-contributors add @gd4Ark code and bug

@allcontributors
Copy link
Copy Markdown
Contributor

@levy9527

I've put up a pull request to add @gd4Ark! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants