Reducing size of monaco-editor dependency
See original GitHub issueHi, I was doing a check of my node_modules folder in a medium sized project and I’m using monaco-editor as a dependency. Monaco-editor ended up being the largest dependency by size in my node_modules folder at 29MB.
I used the following command on Mac OS X to check this:
du -sm node_modules/* | sort -rn | head -n 20
I wanted to see why monaco-editor was taking up so much space so I checked the folder itself:
> du -sm node_modules/monaco-editor/*
1 node_modules/monaco-editor/CHANGELOG.md
1 node_modules/monaco-editor/LICENSE
1 node_modules/monaco-editor/README.md
1 node_modules/monaco-editor/ThirdPartyNotices.txt
16 node_modules/monaco-editor/dev
6 node_modules/monaco-editor/min
7 node_modules/monaco-editor/min-maps
1 node_modules/monaco-editor/monaco.d.ts
1 node_modules/monaco-editor/package.json
Those sizes are in MB. I noticed that monaco-editor ends up packaging “dev”, “min” and “min-maps” in its package.
Since the npm monaco-editor package seems to be built by using a subset of the vscode repository, I was wondering if it was also possible to produce a reduced subset of the monaco-editor repository for people who don’t need the “dev” and “min-maps” directories. Perhaps as “monaco-editor-min” or a separate package since npm doesn’t support it under the same name. This would significantly reduce the size of package needed for a number of users seeing as how monaco-editor is downloaded over ten thousand times a month according to npm stats (https://www.npmjs.com/package/monaco-editor).
Issue Analytics
- State:
- Created 6 years ago
- Reactions:10
- Comments:5
Update your glob input and output in
angular.json
to only copy themin
version to/assets
.Today I have installed and found it is 81.3 MB (85,336,064 bytes) of the entire “monaco-editor” in the production build, which is huge. Would appreciate any suggestions to reduce the size of it.
I am using: