Reputation: 117
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
Reputation: 46761
More of a devops thing but the solution is simply to have 2 apps (or containers):
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