In our case, both test and prod environments are Azure app services. So currently when we deploy to test:

  1. I replace the layoutServiceHost and deployUrl in scjssconfig.json to be the address of QA environment on my local
  2. Run jss deploy files on my local
  3. Copy resulting dist folder to the test environment (cm and cd)

This works, but having to edit a config file manually bothers me as it does not seem like a good and viable solution from a long-term view point & considering having to deploy to prod later too. What are the recommended/other ways to do it? Thank you


Here is the answer you are looking for: [Question] How to control layoutServiceHost value during build?

  • 1
    Hi Nikolay, currently while this does provide an answer to the question, it is a link only answer. When someone goes on Stack Exchange, the question "answer" should actually contain an answer. Not just a bunch of directions towards the answer. Please see this meta post for details on how to update your answer to be Stack Exchange friendly, thanks: meta.stackexchange.com/questions/8231/… – Richard Seal Jan 22 at 13:38
  • thank you! but in my case, would that mean that it's practically same situation, but instead of replacing the host name in scjssconfig.json manually, I would need to do it in the .env file before preparing a build to deploy to test/prod? – Elena P Jan 25 at 13:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.