Bundling for production and integration with MERN
Now that we have features of the VR game implemented and functional with sample game data, we can prepare it for production and add it to our MERN base application to see how VR can be added to an existing web application.
React 360 tools provide a script to bundle all the React 360 application code into a few files that we can just place on the MERN web server and serve as content at a specified route.
Bundling React 360 files
To create the bundled files, we can run the following command from the React 360 project directory:
npm run bundle
This generates compiled versions of the React 360 application files in a folder called build
. The compiled bundle files are client.bundle.js
and index.bundle.js
. These two files, in addition to index.html
 and the static-assets/
folder, make up the production version of the whole React 360 application that was developed:
-- static_assets/ -- index.html -- index.bundle.js -- client.bundle.js