Inline SVG
Having the SVG files loaded as a separate package significantly
increases the load time of the UI, as it forces the images to be
downloaded AFTER the page has loaded.
This commit adds the vue-svg-inline-loader, and appropriate config such
that the styles can be inlined, and a second trip to the BMC is not
required to load the login screen. This improves the "time to glass" of
the webui quite a bit.
Tested: Webui loads. Network tab shows svg files are not loaded. Webui
login page looks correct.
First load of the webui renders 500ms faster (1.9s vs 1.4s)
Change-Id: Iebcd9ab5df6edad0a1a5c53c028eccd2fda8f63c
Signed-off-by: Ed Tanous <ed@tanous.net>
diff --git a/vue.config.js b/vue.config.js
index ad5fb61..769f5c9 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -54,6 +54,12 @@
port: 8000,
},
productionSourceMap: false,
+ chainWebpack: (config) => {
+ config.module
+ .rule('vue')
+ .use('vue-svg-inline-loader')
+ .loader('vue-svg-inline-loader');
+ },
configureWebpack: (config) => {
const crypto = require('crypto');
const crypto_orig_createHash = crypto.createHash;