Creating App:

We use VITE for the project building, its light-weight packaging of ReactJs, compared to Create-React-App this is faster.

npm create vite@latest
cd appName
npm install

Running App:

npm run dev

To Expose to network devices:

npm run dev -- --host

Ports

By default the React Apps gets deployed on port 5173.( http://localhost:5173/ )

<aside> 💡 We can change the port number by using: /package.json:

"scripts": {
  "dev": "vite --host --port 8888",
  // ---- remaining -----
}
//using this changes the vite build code.

The app directly gets exposed to network devices and on http://localhost:8888/

</aside>