'Deployed several HTML sites but unable to host React on Firebase

I have successfully deployed several HTML sites on Firebase but this time trying to publish the React one written on TypeScript when I visit it says Site Not Found

I found one should use build folder when deploying to firebase to look for source, unfortunately I can't find any build but dist available, so I tried the same

Overview of my app structure

  1. src contains assets, main.tsx etc
  2. public (empty directory)
  3. dist gets generated and contains index.html, assets
  4. root contains src, public, dist, index.html, package.json etc

I hope you've realized, I am new to React and just started with a simple Hello World app (works great offline) and just trying to host same on Firebase

Following NPM Commands, I've used to build and run an app offline

  1. npm install
  2. npm run build
  3. npm run dev

That's what package.json looks

{
  "name": "helloworld",
  "version": "0.0.1",
  "private": false,
  "scripts": {
    "build": "tsc && vite build",
    "dev": "vite",
    "format": "prettier --write .",
    "lint": "eslint --fix . --ext .ts,.tsx",
    "lint:css": "stylelint --fix '**/*.css'",
    "preview": "vite preview"
  },
....
}

Link to YouTube tutorial, I always follow to host a website on Firebase



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source