Nuxt.js: Creating staging build

Created on 2 Oct 2020  路  5Comments  路  Source: nuxt/nuxt.js

Hi guys, Im having problem to create a staging folder,
My plan is:

  • Build the project on other folder
  • Then when Its done building I will replace the .nuxt folder with the new build folder ex. .nuxt.stage

My goal is, when the project is still building it should be is working, then when the building proccess is done, I want to replace the old .nuxt with newly created one, which is I named it .nuxt.stage

This is my solution for too long build process, When I build the project, upon building it will display Chunk XX or something, at that time, the site is unavailable,

I tried buildDir on nuxt.config.js but this is not a good a choice, cause it will record the manifest file which links and responsible of linking all files to the .nuxt files

What might be the best solution on this?

bug-report

Most helpful comment

@alfligno Personally I would not recommend building-in-place on a live production server - and definitely not in the same directory. I would suggest you build in a separate directory or (preferably) on a separate server and then move the built artifacts.

All 5 comments

Updates:
As I notice, if .nuxt folder exists then building with .nuxt.stage the server will still stop, instead it will redirected to .nuxt.stage instead of the previous .nuxt, which is should stay on .nuxt

@alfligno Personally I would not recommend building-in-place on a live production server - and definitely not in the same directory. I would suggest you build in a separate directory or (preferably) on a separate server and then move the built artifacts.

@alfligno Personally I would not recommend building-in-place on a live production server - and definitely not in the same directory. I would suggest you build in a separate directory or (preferably) on a separate server and then move the built artifacts.

I did try building the project by using buildDir: "../.nuxt.stage" on nuxt.config.js but when I run the server which is npm run start it points out to the new build file which is .nuxt.stage instead of the old version which is located at the root directory or should I say the .nuxt

Did I miss something? :)

@alfligno I meant, clone your source in a new directory and build there. Still, I'd advise against doing so on a production server.

Thanks for the response, but, that would be alot of work, also a waste of space,
Thanks for the advice 馃憤

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bimohxh picture bimohxh  路  3Comments

pehbehbeh picture pehbehbeh  路  3Comments

vadimsg picture vadimsg  路  3Comments

maicong picture maicong  路  3Comments

mikekidder picture mikekidder  路  3Comments