When building a React (with usual react-scripts/create-creact-app etc.) app via npm build, I always get the entry file in build/index.html.
I've tried moving the src into a subfolder, but the index.js is required to be there in src/index.js.
So how can I change the output path of the index.html?
I.e. e.g. I want to rename it to index.htm, because I am have a pedantic quirk, or I want to change the output path to build/srv/www/index.html?
(These are just examples.)
To change the output path you need to change the webpack config, and in create-react-path is not possible unless you run the eject script.
This way:
npm run eject
After running it, you will be able to access to any project configuration (webpack config in your case), but you must know, once the project is ejected, you can't go back.
More information here:
create-react-app
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With