perhaps a bug in build process (?)
npm run electron, -> generate installer, run installer ->
c:\Program Files\Video Hub App 3\
size: 792 MB (830,843,345 bytes)
(resources folder contain some node modules for all platforms, I believe it should be there, it can all be 4x smaller)
I'm not a fan of the size of the installed app and would love for it to be smaller.
I'm unsure about how to go about decreasing the cruft; any suggestions welcome ๐
If you happen to notice some specific examples where removing just 1 folder we get a good size decrease, perhaps we could target those specifically.
(resources folder contain some node modules for all platforms, I believe it should be there, it can all be 4x smaller)
sorry typo, my bad, it should read: I believe it should NOT be there
If you remove node modules for those platforms not in use (I just left win32-x64 in my case), you'll save 500MB on installation
example:
c:\Program Files\Video Hub App 3\resources\app.asar.unpackednode_modules\@ffmpeg-installer\linux-ia32\
c:\Program Files\Video Hub App 3\resources\app.asar.unpackednode_modules\@ffprobe-installer\linux-ia32\
In fact, I just checked V2 installation did not have those other platform modules in it, it appeared there recently, something changed in the build process
Great catch! I'll definitely see what I can do.
I know we _specifically_ treat the ffmpeg and ffprobe in a special way:
https://github.com/whyboris/Video-Hub-App/blob/main/node/main-extract.ts#L28
const ffmpegPath = require('@ffmpeg-installer/ffmpeg').path.replace('app.asar', 'app.asar.unpacked');
And the dependency _should_ only install the OS-relevant files ๐ค ...
As far as I can tell (going by vague memory), I think the npm run electron will simply copy the node_modules as part of the compilation/build process. So in theory I could delete some specific folders before-hand to reduce size ๐ค
This _Issue_ will be on the check-list before releasing 3.0.0 โ
Interesting ... on my _Windows 10_ both:
Program Files/Video Hub App 2 andProgram Files/Video Hub App 3 folders are 273MB ๐ค
@lighthunt -- I'm unsure what happened on your end, but on mine everything seems fine ๐ค
Consider deleting node_modules and running npm install again ๐ค
My current node_modules is about 800MB, when I build the installer, it comes out to around 100MB, and the installed directory is under 300MB ๐คท
I'll keep this issue in mind - to check file sizes before releasing 3.0.0 but I'm closing this issue at the moment. Please feel free to comment ๐
This is so weird ;-) Those 10 day ago, I've been building both V2 and main in the same git folder with 'npm clean-install' in between checkouts ... and then run the build few times (checkout main) to make sure I do it right.
Few days ago when building and testing translations the size was again under 300M installed, so I have just assumed you or someone has fixed the issue already... weird.
(I don't know, I may have cleaned some more caches (npm in home ... but I think I did this even before V2 build ... ), or who know what happened, I think node_modules were over 1.1GB those days .. ) If it was a false alarm, sorry about that
I'll keep this issue in mind - to check file sizes before releasing 3.0.0
Good idea on the sanity check before release. (may be be automatic in the build ... size <300 ? with warning, you may always update the number later )
Great idea on an automatic check! I'm unsure how to set something like that up without doing some research.
Share your thoughts if you have something in mind already.
My guess is it's not too-hard. Just checking the /release folder for size is enough. Though without having _node_ run a specially-written script I don't yet know how to do it ๐ค
While this won't give a warning, maybe running du -hcs ./release/ would be enough -- a simple reminder about the folder size? ๐ค
_update_: I could include a bash script like this https://stackoverflow.com/a/22295129/5017391 ๐
Thanks @lighthunt -- I implemented a first draft of this. If you happen to know a better way, please let me know ๐ค
Most helpful comment
This is so weird ;-) Those 10 day ago, I've been building both V2 and main in the same git folder with 'npm clean-install' in between checkouts ... and then run the build few times (checkout main) to make sure I do it right.
Few days ago when building and testing translations the size was again under 300M installed, so I have just assumed you or someone has fixed the issue already... weird.
(I don't know, I may have cleaned some more caches (npm in home ... but I think I did this even before V2 build ... ), or who know what happened, I think node_modules were over 1.1GB those days .. ) If it was a false alarm, sorry about that
Good idea on the sanity check before release. (may be be automatic in the build ... size <300 ? with warning, you may always update the number later )