Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
416 views
in Technique[技术] by (71.8m points)

directory - 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.
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...