gpt4 book ai didi

javascript - font-face Styled 组件 - OTS 解析错误 : invalid version tag

转载 作者:行者123 更新时间:2023-11-29 16:02:06 26 4
gpt4 key购买 nike

我正在尝试将几种本地字体添加到新网站。字体似乎已正确下载,字体定义如下:

@font-face {
font-family: 'Roboto Mono';
font-style: normal;
font-weight: 400;
src: url('/fonts/roboto-mono-v5-latin-regular.eot'); /* IE9 Compat Modes */
src: local('Roboto Mono'), local('RobotoMono-Regular'),
url('/fonts/roboto-mono-v5-latin-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('/fonts/roboto-mono-v5-latin-regular.woff2') format('woff2'), /* Super Modern Browsers */
url('/fonts/roboto-mono-v5-latin-regular.woff') format('woff'), /* Modern Browsers */
url('/fonts/roboto-mono-v5-latin-regular.ttf') format('truetype'), /* Safari, Android, iOS */
url('/fonts/roboto-mono-v5-latin-regular.svg#RobotoMono') format('svg'); /* Legacy iOS */
}

但我仍然收到以下错误:

enter image description here

你可以查看我的webpack配置 here .

这是一个公共(public)仓库,在本地运行项目时可以重现该问题:

  1. 克隆:git clone -b feature/font-faces https://github.com/webmadeira/webmadeira.github.io.git

  2. 安装依赖:npm install

  3. 运行项目:npm start

最佳答案

解决方案是更改我的 webpack 配置:

{
test: /.(png|jpg|jp(e)?g|svg)(\?[a-z0-9]+)?$/,
use: {
loader: 'file-loader',
options: {
publicPath: 'images',
name: '/[name].[ext]',
},
},
},

收件人:

{
test: /.(png|jpg|jp(e)?g|svg)(\?[a-z0-9]+)?$/,
use: {
loader: 'file-loader',
options: {
name: 'images/[name].[ext]',
},
},
},

关于javascript - font-face Styled 组件 - OTS 解析错误 : invalid version tag,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51464933/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com