I'm trying to change the src of bundle.js in development with create-react-app.
By default the path is: /static/js/bundle.js
<body>
<div id="root"></div>
</script><script type="text/javascript" src="/static/js/bundle.js"></script></body>
In our production we use Apache as proxy to our API, to test SSO and other functionalities. So I have to add some string to the path, to be like this: myApp/static/js/bundle.js
<body>
<div id="root"></div>
</script><script type="text/javascript" src="myApp/static/js/bundle.js"></script></body>
I tried homepage in package.json, but it only works in npm run build. It also isn't proxy settings, not HOSt in .env
Is this even possible with create-react-app? I checked documentation but didn't find any solution.
you will have to 'npm run eject' and modify the webpack files to change the output.
Little late but if this helps others, this is how you achieve it. After eject, take a look in the config folder, the file: webpack.config.dev.js:
There you could change this values or, second option is to create a .env file and add: