Closed whwnow closed 9 months ago
使用英文描述问题可能能更快地得到反馈 :)
You don’t need to set base for this. It’s still root, you can deploy the default base output and it will work fine. base is only needed for deploying to subpath (like if you want to deploy to foo.com/bar/, then you need to set /bar/ as base)
You don’t need to set base for this. It’s still root, you can deploy the default base output and it will work fine. base is only needed for deploying to subpath (like if you want to deploy to foo.com/bar/, then you need to set /bar/ as base)
In my usage scenario, the URL address for page access is https://a.com/, and I want the URL address for static resources to be https://oss.com/. They are not the same as the page address.
Static resourced in generated html/css/js are relative to your domain - https://developer.mozilla.org/en-US/docs/Learn/Common_questions/Web_mechanics/What_is_a_URL#absolute_urls_vs._relative_urls (refer implicit domain name)
If you don't specify any base manually, then the resultant html will be something like this:
<img class="VPImage image-src" src="/logo.png" alt="..." data-v-...>
If you deploy your site to https://xxx.oss-rg-china-mainland.aliyuncs.com
then the browser will automatically resolve it to https://xxx.oss-rg-china-mainland.aliyuncs.com/logo.png
The domain name of my website and the domain name of static resources are different. To accelerate the delivery of static resources, the static resources are served from a other domain provided by a CDN service provider (Aliyun).
That is not supported yet. Track #2467
That is not supported yet. Track #2467
Get it,Thank you very much for the prompt reply.
Describe the bug
设置带域名的base后,编译后img地址错误
Reproduction
当我设置了base 是一个 oss的域名后,config 配置如下:
base: 'https:/xxx.oss-rg-china-mainland.aliyuncs.com/',
在
index.md
中使用public
目录中的logo.png,部分index.md 如下:但执行 build 后的 dist 目录中,src 的路径中是
https:/xxx
少了一个/
,关键代码如下Expected behavior
应该是https://
System Info
Additional context
No response
Validations