From 33283bd6f04f80d14750869630321a1254a62280 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Manuel=20Barroso=20Galindo?= Date: Thu, 20 Jun 2024 23:06:21 +0200 Subject: [PATCH] Further html optimization and bug fixing. --- www/src/entrypoint.js | 13 +++++++------ www/src/index.html | 33 +++++++++++++++++---------------- www/webpack.common.js | 15 +++++++++++---- 3 files changed, 35 insertions(+), 26 deletions(-) diff --git a/www/src/entrypoint.js b/www/src/entrypoint.js index 9edf6c4..b876f46 100644 --- a/www/src/entrypoint.js +++ b/www/src/entrypoint.js @@ -36,12 +36,13 @@ window.onhashchange = () => { }; Promise.all([ - new FontFaceObserver('Archivo Black', { weight: 400 }).load(null, 10000), - new FontFaceObserver('Lato', { weight: 400 }).load(null, 10000), - new FontFaceObserver('Lato', { weight: 700 }).load(null, 10000) -]).then(() => { + new FontFaceObserver('Archivo Black', { weight: 400 }).load(), + new FontFaceObserver('Lato', { weight: 400 }).load(), + new FontFaceObserver('Lato', { weight: 700 }).load() +]).catch((e) => { + console.warn('Could not load fonts in time!') + console.error(e); +}).finally(() => { const navigator = Navigator.make(); navigator.goToLandingPage(); -}).catch((e) => { - console.error(e); }); diff --git a/www/src/index.html b/www/src/index.html index 3582c54..421ef7f 100644 --- a/www/src/index.html +++ b/www/src/index.html @@ -20,6 +20,7 @@ + - - - - - - - - + <% for (var iCss in htmlWebpackPlugin.files.css) { %><% } %> + <% for (var iJs in htmlWebpackPlugin.files.js) { %><% } %> @@ -54,15 +49,21 @@
- + <% for (var iJs in htmlWebpackPlugin.files.js) { %><% } %> - diff --git a/www/webpack.common.js b/www/webpack.common.js index 959fed4..2588ab8 100644 --- a/www/webpack.common.js +++ b/www/webpack.common.js @@ -38,11 +38,18 @@ module.exports = { }, { test: /\.(jpg|jpeg|gif|png|woff|woff2|eot|ttf|svg|ico)$/, + exclude: [/Loading_icon\.gif$/, /forkme\.png$/], loader: 'url-loader', - options: { - limit: 8192, - fallback: require.resolve('file-loader') - } + options: {limit: 8192} + }, + { + test: /Loading_icon\.gif$/, + loader: 'url-loader', + options: {limit: 65536} + }, + { + test: /forkme\.png$/, + loader: 'file-loader' } ] },