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.
Member comments are a way for members to communicate, interact, and ask questions about a lesson.
The instructor or someone from the community might respond to your question Here are a few basic guidelines to commenting on egghead.io
Be on-Topic
Comments are for discussing a lesson. If you're having a general issue with the website functionality, please contact us at support@egghead.io.
Avoid meta-discussion
Code Problems?
Should be accompanied by code! Codesandbox or Stackblitz provide a way to share code and discuss it in context
Details and Context
Vague question? Vague answer. Any details and context you can provide will lure more interesting answers!