Thịnh Phạm
Thịnh Phạm

Reputation: 2663

Firebase: Deprecation Warning: Firebase Hosting configuration should be moved under "hosting" key

After upgrading my Firebase project, I got this warning message when deploying my project to Firebase hosting.

Deprecation Warning: Firebase Hosting configuration should be moved under "hosting" key.

Anyone has the same problem? How can I fix this?

Upvotes: 9

Views: 2438

Answers (1)

Prits Pri Teish
Prits Pri Teish

Reputation: 166

You just need to modify your firebase.json file which I assume looks somewhat like this:

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

You need to move the different keys specified (in this case, public, ignore and rewrites key) to the hosting key so the snippet above would look like below.

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

Check out this link for more info on Firebase hosting deployment configuration.

Upvotes: 15

Related Questions