In the project directory, you can run:
Runs the app in the development mode.
Open http://localhost:4000 to view it in your browser.
The page will reload when you make changes.
You may also see any lint errors in the console.
Launches the test runner in the interactive watch mode.
See the section about running tests for more information.
Builds the app for production to the build
folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
In this, we have two-phase these are -
// install webpack global
//install webpack and webpack-cli in the project
// add below to scripts section in package.json
Now create a new file which the name webpack.config.js where we mention about starting file, output file, and target. All these are important.
when we run the below command it converts the whole project into a single file.
after the build is complete, let’s add the below npm script to the scripts section in the package.json and run the command
"prod": "node dist/final.js",