I have a react app. In my package.json
:
"build": "react-scripts build",
After running this build script:
npm run build
Everything is built into the build
folder and any files from the public
folder get copied to the root of the build
folder as they are (not minified into chunks). So any static files I want copied over and not changed I can put into the public
folder.
I want to copy a file over as if it were in the public
folder, but from a different folder such as /src/files/config.js
What's the best way to do that? Is it something like adding a webpack.config.js
to the root of my app and having a custom configuration for sending over a file like this? Or maybe just a quick modification to the npm script in package.json
somehow? Or am I missing something...
Thanks