From b37398deddb0d2ca2b49e64cb453f10c4b4a1cf5 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Sun, 16 May 2021 12:21:54 +0200 Subject: [PATCH] Fix fonts. --- frontend/app-config/webpack.config.js | 29 +++++++++++-------- .../pages/dashboard-page.component.scss | 2 +- .../pages/more/more-page.component.scss | 2 +- .../components/assets/asset.component.scss | 2 +- 4 files changed, 20 insertions(+), 15 deletions(-) diff --git a/frontend/app-config/webpack.config.js b/frontend/app-config/webpack.config.js index ec41e5cc8..09a86cb61 100644 --- a/frontend/app-config/webpack.config.js +++ b/frontend/app-config/webpack.config.js @@ -44,11 +44,11 @@ const plugins = { }; module.exports = function calculateConfig(env) { - const isDevServer = path.basename(require.main.filename) === 'webpack-dev-server.js'; const isProduction = env && env.production; - const isTests = env && env.target === 'tests'; - const isTestCoverage = env && env.coverage; const isAnalyzing = isProduction && env.analyze; + const isDevServer = env.WEBPACK_SERVE; + const isTestCoverage = env && env.coverage; + const isTests = env && env.target === 'tests'; const isAot = !isDevServer && !isTests && !isTestCoverage; const configFile = isTests ? 'tsconfig.spec.json' : 'tsconfig.app.json'; @@ -132,20 +132,24 @@ module.exports = function calculateConfig(env) { }, { test: /\.(woff|woff2|ttf|eot)(\?.*$|$)/, use: [{ - loader: 'file-loader?name=[name].[fullhash].[ext]', + loader: 'file-loader', options: { + name: '[name].[hash].[ext]', + + // Store the assets in custom path because of fonts need relative urls. outputPath: 'assets', - /* - * Use custom public path as ./ is not supported by fonts. - */ + + // Use custom public path as ./ is not supported by fonts. publicPath: isDevServer ? undefined : 'assets', }, }], }, { test: /\.(png|jpe?g|gif|svg|ico)(\?.*$|$)/, use: [{ - loader: 'file-loader?name=[name].[fullhash].[ext]', + loader: 'file-loader', options: { + name: '[name].[hash].[ext]', + // Store the assets in custom path because of fonts need relative urls. outputPath: 'assets', }, }], @@ -415,7 +419,10 @@ module.exports = function calculateConfig(env) { config.module.rules.push({ test: /\.ts$/, use: [{ - loader: 'istanbul-instrumenter-loader?esModules=true', + loader: 'istanbul-instrumenter-loader', + options: { + esModules: true, + }, }, { loader: 'ts-loader', }], @@ -467,9 +474,7 @@ module.exports = function calculateConfig(env) { sourceMap: true, }, }], - /* - * Do not include component styles. - */ + // Do not include component styles. include: root('app', 'theme'), }); } diff --git a/frontend/app/features/dashboard/pages/dashboard-page.component.scss b/frontend/app/features/dashboard/pages/dashboard-page.component.scss index d361f88d4..82fa35eee 100644 --- a/frontend/app/features/dashboard/pages/dashboard-page.component.scss +++ b/frontend/app/features/dashboard/pages/dashboard-page.component.scss @@ -85,7 +85,7 @@ gridster-item { &-title { color: $color-title; font-size: 1.2rem; - font-weight: lighter; + font-weight: normal; margin-top: 1rem; } diff --git a/frontend/app/features/settings/pages/more/more-page.component.scss b/frontend/app/features/settings/pages/more/more-page.component.scss index f1e2f1cd7..82b920c27 100644 --- a/frontend/app/features/settings/pages/more/more-page.component.scss +++ b/frontend/app/features/settings/pages/more/more-page.component.scss @@ -53,7 +53,7 @@ &-text { font-size: 1.25rem; - font-weight: lighter; + font-weight: normal; position: absolute; } } diff --git a/frontend/app/shared/components/assets/asset.component.scss b/frontend/app/shared/components/assets/asset.component.scss index b67ec5c9b..f9b635cf4 100644 --- a/frontend/app/shared/components/assets/asset.component.scss +++ b/frontend/app/shared/components/assets/asset.component.scss @@ -267,7 +267,7 @@ $list-height: 2.25rem; &-text { font-size: 1.25rem; - font-weight: lighter; + font-weight: normal; position: absolute; } }