Search code examples
azure-devopsazure-pipelinescreate-react-app

How to get Web.config file in the root of a create-react-app project to copy to the build folder so it gets archived and deployed


I have a file copy task in my build to copy the Web.config in the root of my create-react-app project folder, and it shows that it is copying it to the build file after the yarn build task completes.

But it is never in the archived folder. How do I modify this build or copy files task to get this Web.config file into my build folder so that it can get archived and dropped for release?

enter image description here

I copy it from the $/repo dir/app folder to build (yarn build step creates the build folder)....but the Create release package that archives the build folder does not contain it in the produced zip.

enter image description here

enter image description here

Here's a screenshot of my folder structure in my repo (what's in the $/repo dir/app folder):

enter image description here


Solution

  • In the Copy task you need to specify full path of the build folder, for example:

    $(Build.SourcesDirectory)/build