Web Server

Building the application for production

Once your application is working in the development environment and we want to deploy it to production, we should run the npm production script:

npm run build

This script transpiles our Python code and then bundles it with a different set of options that make our application optimized for a production environment. The source maps are removed, and the JavaScript is minified to make the bundle as small as possible. The bundled files are saved in the bookapp/client/dist/prod/ folder of the project. These files can then be copied to wherever they need to be so that the production web server has access to them to serve them up as static files.

We need to run the above command in the terminal below to ensure that the production build of our application is placed inside the bookapp/client/dist/prod/ folder.

Get hands-on with 1200+ tech skills courses.