I spent some time investigating what's causing this size. Below are my findings:
Skip generating .deb
file to increase speed of test. Also it's not relevant to the test.
I did a quick check on the folders and they are fairly small:
$ du -sh src/ es5/ build/ bin/ images/ _locales/ static/
144K src/
164K es5/
64K build/
16K bin/
300K images/
212K _locales/
2,0M static/
It must be the node_modules/
folder that's causing the big size.
I used the following command for testing size.
rm node_modules && npm install && rm -rf dist/ && npm run dist; ls -al dist/*.AppImage
First lets try if it's a problem with devDependencies
being included.
- size of .AppImage file: 214518973 bytes
- remove
standard
-> 214518649 bytes (-324 bytes) - remove
nodemon
-> 214518789 bytes (+140 bytes) - remove
babel-eslint
-> 214519372 bytes (+583 bytes) - remove
buble
(install globally instead) -> 214518986 bytes (-386 bytes) - remove
depcheck
(not used) -> 214518885 bytes (+/- whatever bytes)
I think it's fairly clear that devDependencies
isn't affecting the resulting image at all, since removing some dependencies adds size to the resulting binary. Also, this is in the magnitude of hundreds of bytes, which is uninteresting. Apparently electron-builder
handles this in a good way.
Lets move on to dependencies.
Lets also revert all devDependencies and start from scratch.
- size of .AppImage file: 214518973
- remove
deltachat-node
-> 200066198 (-14452725), apparently has a bit of effect but "only" 14Mb, there must be something else taking up more space (we might be able to reduce this size as well) - remove
react
-> 200065813 (-385), i.e. 0 effect - remove
react-dom
-> 200066045 (+232), i.e. 0 effect - remove
react-intl
-> 198946736 (-1119309), 1Mb so not a lot - remove
run-parallel
-> 198942483 (-4253), hardly noticable effect - remove
lodash.merge
-> 198938535 (-3948), hardly noticable effect - remove
intl-tel-input
-> 198491122 (-447413), ~450k so not a lot - remove
insert-css
-> 198491286 (+164), i.e. 0 effect - remove
emoji-panel
-> 165022652 (-33468634), ~32Mb so quite a bit, but still a lot to go (this should/could be optimized) - remove
debounce
-> 165017952 (-4700), hardly noticable effect - remove
conversations
-> (errors due to missingreact
andreact-dom
so putting them back) -> 54294609, so roughly 110Mb effect (highest prio) - remove
application-config
-> 54290421 (-4188), hardly noticable effect - remove
@blueprint/core
-> 51215169 (-3075252), ~3Mb so not a lot - remove
arch
-> 51211202 (-3967), hardly noticable effect
We should look further into optimizing the following dependencies and see what's causing this. And in this order.
conversations
(110Mb)emoji-panel
(32Mb)deltachat-node
(14Mb)
Note that this is compressed data, so in reality it's probably a lot more.