Answer the question
In order to leave comments, you need to log in
Strange work with fonts?
Approximate project structure (regarding fonts):
dist
--fonts
----Roboto.ttf
src
--fonts
---Roboto
----Roboto.ttf
Fonts are connected only if I set an absolute path to them. And the path is to src/fonts/
and not dist/fonts
.
At the same time, the fonts folder is not created in dist during assembly.
Will there be problems in the future with such paths?
The second option: (didn't work, I don't know why)
In webpack.config.js I registered publicPath in modules for fonts, as some people advised.
{
test: /\.(?:|woff(2)?|eot|ttf|otf)$/,
type: 'asset/inline',
use: [
{
loader: 'file-loader',
options: {
name: `./fonts/${filename('[ext]')}`,
publicPath: '../',
},
}
],
},
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question