Skip to content

Commit aab1d0a

Browse files
committed
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.
1 parent cedbd36 commit aab1d0a

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
@@ -102,14 +102,6 @@ module.exports = {
102102
splitChunks: {
103103
chunks: 'async',
104104
name: (_, chunks) => chunks.map((item) => item.name).join('-'),
105-
cacheGroups: {
106-
// this bundles all monaco's languages into one file instead of emitting 1-65.js files
107-
monaco: {
108-
test: /monaco-editor/,
109-
name: 'monaco',
110-
chunks: 'async',
111-
},
112-
},
113105
},
114106
},
115107
module: {
@@ -333,5 +325,10 @@ module.exports = {
333325
},
334326
stats: {
335327
children: false,
328+
excludeAssets: [
329+
// exclude monaco's language chunks in stats output for brevity
330+
// https://github.com/microsoft/monaco-editor-webpack-plugin/issues/113
331+
/^js\/[0-9]+\.js$/,
332+
]
336333
},
337334
};

0 commit comments

Comments
 (0)