压缩 css 文件导致 glyphicon 字体无法呈现:资源被解释为字体但以 MIME 类型传输 text/plain

Compressing css files causing glyphicon fonts to not render: Resources interpreted as Font but transferred with MIME type text/plain

我正在使用 glyphicon 字体。当 bootstrap 被压缩并与其他 css 文件捆绑在一起时,图标会停止正确呈现(它们显示为空方块),但当 bootstrap 未压缩时,图标会正确呈现。压缩后,我在加载页面时收到此消息:

资源解释为字体,但使用 MIME 类型传输 text/plain:“/fonts/glyphicons-halflings-regular.woff”

对于每个 glyphyicon 字体文件(.woff、.ttf、.eot、.svg)。

为什么压缩 css 会阻止这些文件被正确解释?当 css 被压缩时,如何让 glyphicon 字体正确呈现?

我通过将我的字体文件夹移动到我的解决方案的根目录解决了这个问题