After creating a successful React 360 app we would like to build it for production environment so that we can release it to the world. In this lesson we are going to learn how to package a React 360 application for production deployment.
When running the server for build
, if you don’t have http-server
downloaded, instead of running the command http-serve build
, run it with npx with the command npx http-server build
.
Instructor: [00:00] We have finished our React physics application. We would like to build it and enter this into production. In order to do that, I add NPM on the bundle inside of your product directory. This is going to take a while.
[00:10] Once this is done, we're going to get a new build folder inside of our product directory. If you have static assets inside of our application, and we do, we need to copy static assets to the build directory.
[00:22] Once this is done, we can run our production build. I'm going to create a new HDP server inside of the build directory. I'm just going to copy this URL to the browser. We can see the result over here. We have a production version of our application.
[00:34] If you take a look inside of the console, we're going to see that it is a production build because development of the warning are off, and performance optimizations are on. We can safely go ahead and deploy this build to a production environment.