简体   繁体   English

Angular 2 - 是否可以为例如styles.78f022854070df211b2d.css添加绝对路径?

[英]Angular 2 - Is it possible to add absolute path to e.g. styles.78f022854070df211b2d.css?

does anybody know if its possible to add the absolute path / domain name to the href for stylesxxxxxx.css in Angular Universal? 有没有人知道是否可以将绝对路径/域名添加到Angular Universal中的stylesxxxxxx.css的href?

I have: link rel="stylesheet" href="styles.78f022854070df211b2d.css" 我有:link rel =“stylesheet”href =“styles.78f022854070df211b2d.css”

I want: link rel="stylesheet" href="https://www.domainname.com/styles.78f022854070df211b2d.css" 我想:link rel =“stylesheet”href =“https://www.domainname.com/styles.78f022854070df211b2d.css”

thanks in advance 提前致谢

您可以在构建时使用--deploy-url选项,但这也会影响js文件的路径。

ng build --prod --deploy-url https://www.domainname.com

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Angular:如何添加全局 CSS(例如添加到正文),但仅针对一个特定页面? - Angular: How to add global CSS (e.g. to the body), but only for one specific page? 如何将静态 CSS 添加到 Dojo 7 应用程序,例如 FontAwesome? - How to add static CSS to Dojo 7 application e.g. FontAwesome? 如何使用 React 多次添加相同的 CSS 属性(例如背景图像)? - How do I add the same CSS property (e.g. background-image) multiple times with React? 对 SVG 组应用 CSS 变换(例如,D3 的缩放变换)导致其文本元素在 Safari 中闪烁 - Applying CSS transform on SVG group (e.g., D3's zoom transform) causes its text elements to flicker in Safari 对CSS中的数据属性(例如模数)进行计算(计算) - Performing calculations (calc) on data attributes in CSS (e.g. modulus) Angular 9 - js 脚本不工作(例如基础或引导程序) - Angular 9 - js scripts not working (e.g. foundations or bootstrap) @Media Breaks CSS 较小时(例如屏幕) - @Media Breaks CSS When Smaller (e.g. screen) div不能使用外部CSS文件设置样式(例如背景) - div can not be styled (e.g. background) with external css file 具有JavaScript和CSS的动画图像(例如非GIF)? - Animated image (e.g. non-GIF) with JavaScript and CSS? 如何在 chrome 中关闭 css 的功能以进行测试,例如 css grid - How can I turn off features of css in chrome for testing e.g. css grid
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM