Webpack 4字体问题

问题描述 投票:0回答:1

我拼命想让我的字体可见,同时用webpack捆绑所有字体,但没有成功。我关注了webpack 4 doc,但它不适用于字体。所有其他的声明似乎都能完美地找到,就像那个字体一样。知道为什么吗?

webpack cfg

{
 test: /\.(woff|woff2|eot|ttf|otf)$/,
 use: ['file-loader']
}

SCSS

@font-face {
    font-family: 'SourceSans';
    src: url('/SourceSans.otf') format('otf')  (/font is the only path that dosent give me an error while bundling)
}

js import sass

import './sass/main.scss;
webpack-4
1个回答
0
投票

更新:问题解决了scss和url的问题(...)这解决了它> https://github.com/bholloway/resolve-url-loader/blob/master/packages/resolve-url-loader/README.md

© www.soinside.com 2019 - 2024. All rights reserved.