I am working with a PHP app ( it's Joomla, but I don't think that matters much - I assume the answer here would be the same regardless of server-side technology ) and I want to embed a React app into one page of it.
I am building the React app outside my main application tree because I only want the output files in my web app. My approach is to use npm run build
to build the React.js app and then copy the output of my /build
folder into the /media/my-app
folder of my site.
The output of my build process is a set of files that look like build/static/js/2.1a11a1a1.chunk.js
, build/static/js/runtime-main.d5223cc00.js
, build/static/js/main.0a010202.chunk.js
and so on. These appear to be indexed by asset-manifest.json
.
Having moved those files into /media/my-app
what do I need to include in my PHP file for the app to work? Do I need to include React independently or is it part of the bundle? What do I need to include in order to be able to run the app from the manifest - I assume those hashed names are not something that we are supposed to be interacting with directly?