Search code examples
reactjscreate-react-appyarnpkg

React create-react-app Change name of static directory when building


I have a react application (created using create-react-app, and built using yarn).

When I build the application (yarn build) I want the static directory and all references to resources in it to be something other than static.

This issue references what I want to do: https://github.com/facebook/create-react-app/issues/1061

So, the question is: How can I change the yarn build process to put static resources in a directory called something other than static?


Solution

  • You need to eject from CRA and config webpack manually, maybe using this plugin https://github.com/webpack-contrib/copy-webpack-plugin