All posts

npm run build command explained

When executing the command npm run build at the root directory of a React app you are preparing the application to push a testing or production environment.

What the command does is minify (strip the whitespace) and bundles all your JS and CSS code each into single file so your browser only has to load one JS and CSS file to render the React application.

These bundled files are located at the root of the applications directory under a build folder. Often that build folder is created using mkdirp which makes it a private directory so to view it on the command line run ls -a from your the root of your application.


I built two products to help fund continued efforts for this website, it would mean a lot if you would check them out:
1. 2500+ Words for the Undermotivated Software Engineer - A short essay I wrote on the titled topic ($3).
2. Build 3 Chrome Extensions in Under 2 Hours - A course I built to teach chrome extension development ($9-20).