@chengtie I would suggest you to use the lazy load approach with webpack.
For example this will load a monaco bundle separately.
import(/* webpackChunkName: "monaco-editor" */ 'monaco-editor').then(() => {
// your code here
});
As you can also notice while building the project that webpack generates a lot of 1.js, 2.js, etc files (which contain language set ups [js, css, python, etc]). They are also being loaded asynchronously inside monaco.
You can also skip unnecessary features from the build. You can find an example here.
Most helpful comment
You can also skip unnecessary features from the build. You can find an example here.