angular - Angular 8 CSS 不会在刷新、生产构建时加载
问题描述
我的 index.html 看起来像这样:
<!doctype html>
<html lang="hu">
<head>
<meta charset="utf-8">
<title>WebsiteName</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- etc -->
当我使用“ng build”时,代码运行良好,但是当我在生产模式下编译它(使用“ng build --prod”)时,它似乎运行良好,但重新加载时会禁用 style.css。
更新:@Elizaveta 的回答是正确的,但是新的问题是
<link rel="stylesheet" href="styles.d42b9ef58619804546db.css">
由“ng build --prod”生成,如下所示:
<link rel="stylesheet" href="styles.d42b9ef58619804546db.css"><!doctype html>
<html lang="hu">
<head>
<meta charset="utf-8">
<title>Nebulónia</title>
<base href="/">
<!-- etc -->
我如何告诉 Angular 在哪里生成它?
这是完整的 github 仓库:https ://github.com/lori2001/NebuloniaWebsite
解决方案
推荐阅读
- java - 是否有不带参数、不返回任何内容并允许检查异常的 JDK 功能接口?
- c# - XML反序列化/序列化问题
- javascript - Webfont 在 Node.js/Express 上被 CORS 阻止,但缺少标头,即使已设置
- javascript - 在 JavaScript 字符串中动态存储多个值
- powershell - PowerShell 将 Echo 输出发送到电子邮件
- flutter - 无法使用 3rd 方库找到文本小部件
- php - 在 PHP 中保存 url 生成的 excel
- mongodb - 使用索引时,MongoDB 在排序期间崩溃
- java - Maven 依赖更改 commons-io 版本
- java - @OneToOne JPA 中未映射列