Rizal Yogi Pratama
Rizal Yogi Pratama

Reputation: 117

How to rollout on production while building a new Nuxt app

Is there any best practice for building and releasing a Vue/Nuxt project on production, especially for a large app that needs a long time to build?

Currently, if we run command

npm run build

The user is unable to access the app until the build process is done.

Is there any idea/way to make the users still able to access the site while we are still building it?

Upvotes: 1

Views: 282

Answers (1)

kissu
kissu

Reputation: 46761

More of a devops thing but the solution is simply to have 2 apps (or containers):

    1. the current production one, totally working
    1. the one freshly pushed and currently building

Once the build is done on the 2., just swap (the term used is rollout AFAIK) 1. by 2. and your users will have the new app on a fresh reload or a new visit (SPA needs to be updated).

I know that you can even make some configuration to have a progressive rollout, like

let 20% of our userbase having the new codebase while the other 80% are on the old version, until we are sure that everything is fine and that we can rollout for everybody

Usually, JAMstack PaaS (Netlify, Vercel, etc...) do that for you.

Upvotes: 1

Related Questions