From b34e6363791fe44f7c5e4eea2c040a2c8f659e73 Mon Sep 17 00:00:00 2001 From: Art Lowel Date: Fri, 22 Nov 2019 18:14:02 +0100 Subject: [PATCH] Add support for locally hosted fonts --- webpack/webpack.common.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/webpack/webpack.common.js b/webpack/webpack.common.js index 028815d958..806c0c6f40 100644 --- a/webpack/webpack.common.js +++ b/webpack/webpack.common.js @@ -15,6 +15,9 @@ module.exports = (env) => { let copyWebpackOptions = [{ from: path.join(__dirname, '..', 'node_modules', '@fortawesome', 'fontawesome-free', 'webfonts'), to: path.join('assets', 'fonts') + }, { + from: path.join(__dirname, '..', 'resources', 'fonts'), + to: path.join('assets', 'fonts') }, { from: path.join(__dirname, '..', 'resources', 'images'), to: path.join('assets', 'images') @@ -24,6 +27,15 @@ module.exports = (env) => { } ]; + const themeFonts = path.join(themePath, 'resources', 'fonts'); + if(theme && fs.existsSync(themeFonts)) { + copyWebpackOptions.push({ + from: themeFonts, + to: path.join('assets', 'fonts') , + force: true, + }); + } + const themeImages = path.join(themePath, 'resources', 'images'); if(theme && fs.existsSync(themeImages)) { copyWebpackOptions.push({ @@ -161,7 +173,7 @@ module.exports = (env) => { ] }, { - test: /\.html$/, + test: /\.(html|eot|ttf|svg|woff|woff2)$/, loader: 'raw-loader' } ]