From 94e655e5b37cc8d1abe31a3a41403f3179a1a2ac Mon Sep 17 00:00:00 2001 From: David Wallace Date: Thu, 11 Apr 2024 10:48:04 +0200 Subject: [PATCH] build: fix webpack fonts loader Signed-off-by: David Wallace --- webpack/common.config.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/webpack/common.config.js b/webpack/common.config.js index 57f6f89b9b..6baeebe52f 100644 --- a/webpack/common.config.js +++ b/webpack/common.config.js @@ -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, } } ]