Search code examples
reactjsbuildbundle

React build prevent to remove unused images


I have a React project created with CRA and yarn. I have some images in my assets folder that aren't being used. When I run yarn build and check the build folder I noticed that those images disaperead. I understand that this is for optimization, but I will need those images available.

How can I prevent those images being removed?


Solution

  • Since there are a few images that I didn't want to be deleted in the build process I move them to the public/ folder.