3

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

Shayki Abramczyk
  • 36,824
  • 16
  • 89
  • 114
user1368182
  • 423
  • 7
  • 18

3 Answers3

2

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

$(Build.SourcesDirectory)/build
Shayki Abramczyk
  • 36,824
  • 16
  • 89
  • 114
  • That doesn't seem to copy it either. It's still not making it into the release package. The build log indicates it completed the step, but it isn't there - log message: Copying D:\a\9\s\[app root folder]\Web.config to D:\a\9\s\build\Web.config – user1368182 Dec 16 '19 at 14:32
  • Ok, so as it turns out, the target folder needed to be $(Build.SourcesDirectory)/[app root folder]/build because of how my particular folder structure is - I have a root app folder, then the build folder in that - but I believe your solution is what would apply to this case in most instances ...and what was also needed was to change the project directory for the Yarn Install and Yarn Build tasks to be $(Build.SourcesDirectory)/[app root folder], and then the Create Release Package task to use $(Build.SourcesDirectory)/[app root folder]/build as well. After that, it all worked. – user1368182 Dec 26 '19 at 15:38
1

Include the web.config file in the public folder

Now the file gets included in the build and dropped for release

Abu Talha
  • 11
  • 3
0

Because you have coded all the paths, I can’t analyze this issue according to your specific situation.

You can specify the Web.config file from ... to see if it can be successfully copied to the build folder.

enter image description here

It would be much easier for people to investigate further and reply if you could attach detailed file path and logs.

Hugh Lin
  • 17,829
  • 2
  • 21
  • 25