I have a relatively small meteor app. Probably not more than 5000 lines including css/html/js. It uses a few packages like iron:router and accounts-???. When I build the bundle it’s 125meg!! Checking the build folder I see lots of compile time dependencies are in there (babel, eslint, coffeescript, …).
While I can manually try to delete them is there any meteor command/option to pair this stuff down? Basically uploading 125meg to my live server seems like a waste. Of course the tar.gz as smaller (40meg) but that’s still 40 meg to upload and then decompress into 125meg.
Of course at one level 125meg is not that big and I don’t deploy every day. On the other hand lots of small files get padded out to sectors. My mac says “254mb space used on disk” for example. I’m sure it’s the same on the server.
Even for dev it’s not fun. Sure, locally I can run directly from the build folder but then for staging it’s a several minute upload every time to test. I can send the source and build on the staging server but that’s not really a help. The build takes minutes, tons of memory, and all the build deps get installed so it doesn’t actually save any space it only saves upload time. Iteration time is actually slower because of build times.
The only thing I could think of is trying to run
npm prune --production but that failed. Maybe I don’t know where to run it. Tried running in in build/bundle/programs/server and got an error
error May not delete: build/bundle/programs/server/node_modules/.bin. Even looking at the
package.json in that folder it’s not clear it would have deleted much.
Are there any known solutions short of manually deleting folders?
Anything that could make iteration when uploading faster and smaller would be great!
To answer my own question I started using rsync to upload. Doesn’t help the disk space issues but does help just push the smallest number of changes.