diff options
author | silverwind | 2020-07-06 10:56:54 +0200 |
---|---|---|
committer | GitHub | 2020-07-06 11:56:54 +0300 |
commit | 62c2c1703112390db57d163d0f0c9cfe9c7ff97f (patch) | |
tree | 3cfbdcdc3dfb5af39d6ecaea31a827c9179084d2 /webpack.config.js | |
parent | 9fc9c1de98aff0329f358753ba5b2635dd522ac3 (diff) |
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 <art27@cantab.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
Diffstat (limited to 'webpack.config.js')
-rw-r--r-- | webpack.config.js | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/webpack.config.js b/webpack.config.js index 72d83522d..40a184eb4 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 = { |