Skip to content

Commit 4d9f59a

Browse files
authored
Split up monaco's language chunks (#12401)
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.
1 parent 7b260ac commit 4d9f59a

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

webpack.config.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,6 @@ module.exports = {
9797
splitChunks: {
9898
chunks: 'async',
9999
name: (_, chunks) => chunks.map((item) => item.name).join('-'),
100-
cacheGroups: {
101-
// this bundles all monaco's languages into one file instead of emitting 1-65.js files
102-
monaco: {
103-
test: /monaco-editor/,
104-
name: 'monaco',
105-
chunks: 'async',
106-
},
107-
},
108100
},
109101
},
110102
module: {
@@ -325,5 +317,10 @@ module.exports = {
325317
},
326318
stats: {
327319
children: false,
320+
excludeAssets: [
321+
// exclude monaco's language chunks in stats output for brevity
322+
// https://github.com/microsoft/monaco-editor-webpack-plugin/issues/113
323+
/^js\/[0-9]+\.js$/,
324+
],
328325
},
329326
};

0 commit comments

Comments
 (0)