diff options
author | Ed Tanous <ed@tanous.net> | 2024-04-21 02:35:34 +0300 |
---|---|---|
committer | Ed Tanous <ed@tanous.net> | 2024-04-26 08:09:46 +0300 |
commit | 740cbd525fa619e6a4190ec08c80f45ae72435eb (patch) | |
tree | 06f417e372fc699b737db26add7f8e1a3521d2aa | |
parent | bceafface3899539006e8f04717e7fd5bf491ac5 (diff) | |
download | webui-vue-740cbd525fa619e6a4190ec08c80f45ae72435eb.tar.xz |
Limit to one chunk
Considering that currently, there's no way to load the login page
without both the main json, and the 1 vendor chunk, chunking itself gets
us no extra performance, and makes it harder on the bmc, because we now
have to respond to two requests instead of one. These requests in
practice happen serially, so on high RTT connections, it can be a
negative on performance.
Simplify by changing the webpack settings to produce one chunk.
Tested: Webui loads properly. No errors on console when clicking
around.
Change-Id: Ida5bb748429137eb2414be1990168affe1d001af
Signed-off-by: Ed Tanous <ed@tanous.net>
-rw-r--r-- | vue.config.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/vue.config.js b/vue.config.js index 769f5c90..bd226746 100644 --- a/vue.config.js +++ b/vue.config.js @@ -1,4 +1,6 @@ const CompressionPlugin = require('compression-webpack-plugin'); +const webpack = require('webpack'); +const LimitChunkCountPlugin = webpack.optimize.LimitChunkCountPlugin; module.exports = { css: { @@ -61,6 +63,16 @@ module.exports = { .loader('vue-svg-inline-loader'); }, configureWebpack: (config) => { + config.plugins.push( + new LimitChunkCountPlugin({ + maxChunks: 1, + }), + ); + config.optimization.splitChunks = { + cacheGroups: { + default: false, + }, + }; const crypto = require('crypto'); const crypto_orig_createHash = crypto.createHash; crypto.createHash = (algorithm) => @@ -97,6 +109,14 @@ module.exports = { }), ); } + + config.performance = { + hints: 'warning', + maxEntrypointSize: 512000, + maxAssetSize: 512000, + }; + + config.optimization.runtimeChunk = false; }, pluginOptions: { i18n: { |