我创建了一个带角度cli的角度5项目。在angular-cli.json样式标记中引用了css。
"styles": [
"styles.css",
"static/css/custom.css",
"static/css/style.bundle.css",
"static/css/vendors.bundle.css",
"static/css/fullcalendar.bundle.css"
]
当我尝试在浏览器中运行应用时我在控制台
中得到字体文件中止错误GET http://localhost:4200/fonts/font-awesome/fontawesome-webfont.woff2?v=4.7.0 net::ERR_ABORTED
fonts/font-awesome/fontawesome-webfont.woff?v=4.7.0:1 GET http://localhost:4200/fonts/font-awesome/fontawesome-webfont.woff?v=4.7.0 net::ERR_ABORTED
fonts/font-awesome/fontawesome-webfont.ttf?v=4.7.0:1 GET http://localhost:4200/fonts/font-awesome/fontawesome-webfont.ttf?v=4.7.0 net::ERR_ABORTED
这些字体文件正在vendors.bundle.css中使用
src: url("fonts/socicon/socicon.eot")
更改为src:url("/fonts/socicon/socicon.eot")
。我试图像这样加载css,
<link rel="stylesheet" type="text/css" ref="./static/css/style.bundle.css"/>
但它给了我这个错误
**because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled**