默认情况下,在dist / index.html中创建了此类链接:
<link href=/js/app.2e806e0c.js rel=preload as=script>
<link href=/js/chunk-vendors.bc9ee6a2.js rel=preload as=script>
<link href=/css/chunk-vendors.fc712ce5.css rel=stylesheet>
<link href=/css/app.64eef18a.css rel=stylesheet>
<script src=/js/chunk-vendors.bc9ee6a2.js></script>
<script src=/js/app.2e806e0c.js></script>
如何更改与此链接?
<link href=js/app.2e806e0c.js rel=preload as=script>
<link href=js/chunk-vendors.bc9ee6a2.js rel=preload as=script>
<link href=css/chunk-vendors.fc712ce5.css rel=stylesheet>
<link href=css/app.64eef18a.css rel=stylesheet>
<script src=js/chunk-vendors.bc9ee6a2.js></script>
<script src=js/app.2e806e0c.js></script>
答案 0 :(得分:3)
有关 Vue CLI 3.3 + ,请参阅@DoronG's answer below
您可以通过baseUrl
选项更改此选项,必须在项目根目录的vue.config.js
文件中进行设置:
module.exports = {
baseUrl: ''
};
答案 1 :(得分:1)
在@yuriy636之后回答,baseUrl
现在为deprecated,您应该改用publicPath
:
module.exports = {
publicPath: ""
};