Reputation: 12445
I am using apache to host the ReactProject
I put .htpasswd
and .htaccess
in ReactProject/build
directory, it works.
However once I did npm run build
again.
Both files were deleted.
How can I prevent this??
Upvotes: 1
Views: 1060
Reputation: 11
you can put them in a public folder!
The reason the files were deleted is whenever you npm run build, public folder moved to build folder. It simply means if you do npm run build, the build folder is made by public folder.
Upvotes: 1