错误的样式束路径 [英] The wrong styles bundle path
本文介绍了错误的样式束路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个带有angular-cli aot的angular 4应用程序,并且在azure Web应用程序上构建了产品版本
我注意到在某些页面样式包中尝试通过相对路径找到它
结果,我在控制台中看到下一个错误:
I have a angular 4 app with angular-cli aot, and I build the prod version on azure web app
I noticed that on some pages styles bundle try to find it by relative path
As result I see next error in console:
GET http://example.com/en/styles.b0bf326c21a7f4ee7e7f.bundle.css net::ERR_ABORTED
在html中,我看到css不是从"/"开始的:
in the html I see that css doesn't start from "/":
<link href="styles.b0bf326c21a7f4ee7e7f.bundle.css" rel="stylesheet">
我该如何解决?
谢谢
推荐答案
找到了解决方案这里
-deploy-url(别名:-d)
--deploy-url (aliases: -d)
将在其中部署文件的URL.
URL where files will be deployed.
node ./node_modules/@angular/cli/bin/ng build --prod --deploy-url /
这篇关于错误的样式束路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文