user1368182
user1368182

Reputation: 473

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

Upvotes: 3

Views: 2372

Answers (3)

Abu Talha
Abu Talha

Reputation: 21

Include the web.config file in the public folder

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

Upvotes: 2

Hugh Lin
Hugh Lin

Reputation: 19461

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.

Upvotes: 0

Shayki Abramczyk
Shayki Abramczyk

Reputation: 41755

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

$(Build.SourcesDirectory)/build

Upvotes: 2

Related Questions