From 7afa83882e2b1256f9b5c54a1068e24e4a70c6c0 Mon Sep 17 00:00:00 2001 From: silverwind Date: Wed, 8 Jul 2020 21:45:54 +0200 Subject: [PATCH 1/2] Split up monaco's language chunks This should speed up monaco's loading time by splitting the current 3.71MB chunk monaco.js into 63 individual files named 1 to 63.js in the output directory. There seems to be no way to get a better file naming scheme unfortunately. I opted to exclude those files in the webpack output for brevity. --- webpack.config.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/webpack.config.js b/webpack.config.js index f21c481995184..c2638c8b1cf97 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -97,14 +97,6 @@ module.exports = { splitChunks: { chunks: 'async', name: (_, chunks) => chunks.map((item) => item.name).join('-'), - cacheGroups: { - // this bundles all monaco's languages into one file instead of emitting 1-65.js files - monaco: { - test: /monaco-editor/, - name: 'monaco', - chunks: 'async', - }, - }, }, }, module: { @@ -325,5 +317,10 @@ module.exports = { }, stats: { children: false, + excludeAssets: [ + // exclude monaco's language chunks in stats output for brevity + // https://github.com/microsoft/monaco-editor-webpack-plugin/issues/113 + /^js\/[0-9]+\.js$/, + ] }, }; From 93ea23551ebdcb297ca3167b1cdb5f2c323a835f Mon Sep 17 00:00:00 2001 From: silverwind Date: Sun, 2 Aug 2020 11:02:48 +0200 Subject: [PATCH 2/2] trailing comma --- webpack.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webpack.config.js b/webpack.config.js index c2638c8b1cf97..e733a7784ed5a 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -321,6 +321,6 @@ module.exports = { // exclude monaco's language chunks in stats output for brevity // https://github.com/microsoft/monaco-editor-webpack-plugin/issues/113 /^js\/[0-9]+\.js$/, - ] + ], }, };