I am using create-react-app and running react-scripts build on a my project, but I'm having an issue with the build output. I need the build output to go in a subdirectory of the build folder like shown here
Build
-- Player
And I need the Urls for the generated for the JS and CSS files as shown here to include the Player in the path. I need these.
<link href="/static/css/main.02096f02.css" rel="stylesheet">
<script type="text/javascript" src="/static/js/main.75412701.js"></script>
to be these
<link href="/player/static/css/main.02096f02.css" rel="stylesheet">
<script type="text/javascript" src="/player/static/js/main.75412701.js"></script>
I need this to automate my build and deployment. Otherwise the default scripts work perfectly.
If you set the homepage attribute in your package.json
file, that will modify all the links generated in /build/index.html
. Here's the docs.
"homepage": "http://mywebsite.com/relativepath",
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