[Vuejs]-Ionic Vue 3 on subdomain on Firebase Hosting not finding index.html

0๐Ÿ‘

โœ…

So the solution is firebase.json related. As there are multiple sites in the hosting you have a firebase.json for each site plus one at a root level. The root level firebase.json maps subdomain to the site. I needed to add the rewrites section to the root firebase.json as well.

   {
    "hosting": [{
      "target": "www",
      "public": "public-area/dist",
      "ignore": [
        "firebase.json",
        "**/.*",
        "**/node_modules/**"
      ]
    },
  {
      "target": "portal",
      "public": "portal-area/dist",
      "ignore": [
        "firebase.json",
        "**/.*",
        "**/node_modules/**"
      ],
      "rewrites": [                      <-- added
        {                                <-- added
          "source": "**",                <-- added
          "destination": "/index.html"   <-- added
        }                                <-- added
      ]                                  <-- added
  }]
  }

Leave a comment