Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reason behind the large size of meteor js apps/projects

I've been cleaning up my directories and noticed that each Meteor.js project takes up at least 77MB (and typically, more like 150MB)! To figure out what was happening, I went ahead and created a new app:

meteor create myapp

At this point, the folder takes up about 7kb. But after I do this

cd myapp
meteor

the folder size balloons up to 77MB.

After some digging around, I managed to pinpoint to size increase the .meteor/db folder. More specifically, running the app creates these local* files inside .meteor/db which are each >16Mbs. I opened these and they're mainly just a long string of 0000s with a few non-0000s here and there. If I start doing more -- adding data, to Meteor.collections, etc -- the size balloons to 100+MB.

My questions

  • What are these files for and why are they so huge?
  • Is there any way to make my app smaller (zipping the folder cuts the size down to 1.8MB so a lot of the additional bloat looks like it could be stripped away somehow.
like image 892
adilapapaya Avatar asked Mar 04 '14 17:03

adilapapaya


2 Answers

Running meteor in development mode (the default) creates an instance of mongodb for you under your .meteor directory. It's huge, I know. But don't worry - this is only for development so you don't need to setup your own mongodb instance on your localhost. You can clean it up at any time by running:

$ meteor reset

When you go to deploy your app, you will bundle your project which does not include any of these files.

like image 176
David Weldon Avatar answered Nov 02 '22 19:11

David Weldon


To add to what David Weldon said.

If the size of the app locally is an issue, you could always use a Mongo database that is not stored locally, like a mongodb-as-a-service provider such as: MongoLab or MongoHQ

like image 3
1321941 Avatar answered Nov 02 '22 21:11

1321941