Skip to content

Commit

Permalink
build: fix webpack fonts loader
Browse files Browse the repository at this point in the history
Signed-off-by: David Wallace <david.wallace@tu-darmstadt.de>
  • Loading branch information
MyPyDavid committed Apr 11, 2024
1 parent 3909982 commit 94e655e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions webpack/common.config.js
Expand Up @@ -37,12 +37,15 @@ const base = {
]
},
{
test: /(fonts|files)\/.*\.(svg|woff2?|ttf|eot|otf)(\?.*)?$/,
test: /\.(svg|woff2?|ttf|eot|otf)$/,
type: 'javascript/auto',
include: /fonts/, // This line ensures only files in the 'fonts' folder are processed
loader: 'file-loader',
options: {
name: '[name].[ext]',
outputPath: 'fonts',
postTransformPublicPath: (p) => `'../' + ${p}`
outputPath: 'fonts/', // Output directory for the fonts within the output path of webpack
publicPath: '../fonts/', // Sets correct public path to reference fonts in the CSS
esModule: false,
}
}
]
Expand Down

0 comments on commit 94e655e

Please sign in to comment.