流星js应用程序/项目大的原因 [英] Reason behind the large size of meteor js apps/projects
问题描述
我一直在清理我的目录并注意到每个 Meteor.js 项目占用至少 77MB(通常更像是 150MB)!为了弄清楚发生了什么,我继续创建了一个新应用:
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
此时文件夹大约占用7kb.但是在我这样做之后
At this point, the folder takes up about 7kb. But after I do this
cd myapp
meteor
文件夹大小气球高达 77MB.
the folder size balloons up to 77MB.
经过一番挖掘后,我设法确定增加.meteor/db
文件夹的大小.更具体地说,运行该应用程序会在 .meteor/db
中创建这些 local*
文件,每个文件都 >16Mbs.我打开了这些,它们主要是一长串 0000
和一些非 0000
在这里和那里.如果我开始做更多的事情——添加数据,到 Meteor.collections
等——大小会膨胀到 100+MB.
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 0000
s with a few non-0000
s here and there.
If I start doing more -- adding data, to Meteor.collections
, etc -- the size balloons to 100+MB.
我的问题
- 这些文件有什么用?为什么它们这么大?
- 有什么方法可以让我的应用程序更小(压缩文件夹将大小减少到 1.8MB,所以很多额外的膨胀看起来可以以某种方式剥离.
推荐答案
在开发模式(默认)下运行meteor 会在你的 .meteor
目录下为你创建一个 mongodb 实例.它巨大,我知道.但别担心 - 这仅用于开发,因此您无需在本地主机上设置自己的 mongodb 实例.您可以随时运行以下命令进行清理:
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.
这篇关于流星js应用程序/项目大的原因的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!