[Vuejs]-Not sure why my Vue app build.js file appears to be my index.html file after build in Firebase

0๐Ÿ‘

โœ…

you firebase.json should look like this:

hosting": {
    "public": "dist",
    "ignore": [
      "firebase.json",
      "**/.*",
      "**/node_modules/**"
    ],
    "rewrites": [
      {
        "source": "**",
        "destination": "/index.html"
      }
    ]
  },

Run firebase deploy --only hosting and it should be good. Source here

Make sure your output for that command looks something like this:

=== Deploying to 'your-project-name'...

i  deploying hosting
i  hosting[zero-to-prod-test]: beginning deploy...
i  hosting[zero-to-prod-test]: found 16 files in public/build <---- THIS TELLS YOU IF THE FILES ARE BEING COPIED
โœ”  hosting[zero-to-prod-test]: file upload complete
i  hosting[zero-to-prod-test]: finalizing version...
โœ”  hosting[zero-to-prod-test]: version finalized
i  hosting[zero-to-prod-test]: releasing new version...
โœ”  hosting[zero-to-prod-test]: release complete

That way to can debbug is something is wrong on the data transfer.

On your case your index.html is pointing to dist/build.js intead of /build.js that is causing the problem, so it doesnt look like a firebase problem but a webpack problem. Check your assets generation process.

Leave a comment