“流星"vs “流星束"用于生产 [英] "meteor" vs "meteor bundle" for production

查看:26
本文介绍了“流星"vs “流星束"用于生产的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于生产为什么我应该捆绑"流星应用程序而不是仅仅复制服务器上的源使用meteor"命令?

For production why should I "bundle" the meteor application and not just copy the sources on the server use the "meteor" command?

基本上有什么区别:

  • meteor bundle app.tar.gz",然后安装正确版本的纤维和nodejs并提取存档并从node main.js"应用程序开始,

  • "meteor bundle app.tar.gz", then installing the right version of fibers and nodejs and extracting the archive and starting with "node main.js" the app,

并复制服务器上的项目源代码,只需编写meteor"即可启动应用程序?

and copying the project sources on the server and just writing "meteor" to start the app?

推荐答案

这不会是一个详尽的列表,但这里有一些 meteor 命令所做的事情:

This won't be an exhaustive list, but here are some things that the meteor command does:

  1. 创建本地数据库
  2. 监视应用或包中的每个依赖文件
  3. 将每个文件单独发送给客户端(除非您在本地开发,否则效率极低)

相比之下,捆绑应用:

  1. 不创建本地数据库
  2. 不会花费 CPU 来监视您的文件是否有变化
  3. 创建两个缩小的文件(js 和 css),非常适合放置 CDN 或从 反向代理.这些对于客户端下载也很有效,并且具有高度可缓存性.
  1. does not create a local database
  2. does not spend CPU watching your files for changes
  3. creates two minified files (js and css) which is perfect for putting on a CDN or hosting from a reverse proxy. These are also efficient for clients to download and are highly cacheable.

总的来说,如果您使用一套好的 脚本.

In general, deploying shouldn't be a huge pain if you use a good set of scripts.

这篇关于“流星"vs “流星束"用于生产的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆