Simplify and clarify Webpack font config

This commit is contained in:
Koen Vlaswinkel
2022-09-01 11:21:06 +02:00
parent fa4dd087e5
commit ba8b32078d

View File

@@ -57,13 +57,15 @@ export const config: webpack.Configuration = {
]
},
{
test: /\.(woff(2)?|ttf|eot|svg)$/,
test: /\.(woff(2)?|ttf|eot)$/,
use: [
{
loader: 'file-loader',
options: {
name: '[name].[ext]',
outputPath: 'fonts/',
// We need this to make Webpack use the correct path for the fonts.
// Without this, the CSS file will use `url([object Module])`
esModule: false
}
},