From 62c2c1703112390db57d163d0f0c9cfe9c7ff97f Mon Sep 17 00:00:00 2001 From: silverwind Date: Mon, 6 Jul 2020 10:56:54 +0200 Subject: Fonts rework (#12114) - Use system fonts only for text to avoid FOUT - Move font-awesome to npm/webpack - Move NotoColorEmoji to web_src - Remove presumably unneccesary 'PT Sans Narrow' - Simplify webpack import exclusions Fixes: https://github.com/go-gitea/gitea/issues/11818 Fixes: https://github.com/go-gitea/gitea/pull/11814 Co-authored-by: zeripath Co-authored-by: Lauris BH --- webpack.config.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'webpack.config.js') diff --git a/webpack.config.js b/webpack.config.js index 72d83522d2..40a184eb44 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -25,15 +25,17 @@ const isProduction = process.env.NODE_ENV !== 'development'; const filterCssImport = (parsedImport, cssFile) => { const url = parsedImport && parsedImport.url ? parsedImport.url : parsedImport; const importedFile = url.replace(/[?#].+/, '').toLowerCase(); - if (/vendor\/assets/.test(url)) return false; // font imports - if (/web_src[/\\]less/.test(cssFile)) return true; // relative imports - if (cssFile.includes('monaco')) return true; + if (cssFile.includes('fomantic')) { if (/brand-icons/.test(importedFile)) return false; - if (/(eot|ttf|woff)$/.test(importedFile)) return false; - return true; + if (/(eot|ttf|otf|woff)$/.test(importedFile)) return false; + } + + if (cssFile.includes('font-awesome')) { + if (/(eot|ttf|otf|woff|svg)$/.test(importedFile)) return false; } - return cssFile.includes('node_modules'); + + return true; }; module.exports = { -- cgit v1.2.3