Firebase Hosting with Vue.js

1

I have a problem with Firebase Hosting when uploading my Vue.js project that connects with firebase

The architecture of the files is as follows.

and the file firebase.json is the following

or in code

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

Screenshot of firebase error

Greetings, thanks in advance.

    
asked by Carlosgub 12.09.2018 в 02:41
source

1 answer

2

The error is telling you that you can not find the file index.html in the folder you designated, in this case "public": "src" .

Try first changing the public folder in firebase.json :

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

Then run npm run build to create the dist folder where you create the files ready for production that you will upload, and finally execute firebase deploy .

    
answered by 12.09.2018 / 04:32
source