“meteor” vs “meteor bundle” for production

前端 未结 2 1798
北荒
北荒 2020-12-06 05:12

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

Basically what is the differenc

2条回答
  •  执笔经年
    2020-12-06 05:39

    When using a bundle:

    1. It will not spawn meteor-mongo(Mongodb inside meteor)
    2. No hot reloads
    3. Meteor will not watch your files.
    4. You can leave/quit the server without killing your app.
    5. You can manage node processes smoothly by using pm2 or other similar npm packages.
    6. You can decide where to put your mongoDB and decide what port to use.
    7. You can connect to your mongodb remotely by not having to run your meteor app.

    While using a copy or running meteor command in the project directory:

    1. You can't leave/quit the server while keeping the project running without using any screen multiplexers (e.g. tmux)
    2. You can only use meteor's assigned mongodb which is spawned in localhost:3001 -- if meteor is using port 3000.
    3. You are letting meteor to watch over file changes which uses CPU.
    4. When your app dies, your db dies. :)

提交回复
热议问题