6
升級我的Firebase項目後,我在將項目部署到Firebase託管時收到此警告消息。Firebase:棄用警告:Firebase託管配置應該在「託管」密鑰下移動
Deprecation Warning: Firebase Hosting configuration should be moved under "hosting" key.
任何人有同樣的問題?我怎樣才能解決這個問題?
升級我的Firebase項目後,我在將項目部署到Firebase託管時收到此警告消息。Firebase:棄用警告:Firebase託管配置應該在「託管」密鑰下移動
Deprecation Warning: Firebase Hosting configuration should be moved under "hosting" key.
任何人有同樣的問題?我怎樣才能解決這個問題?
你只需要修改firebase.json文件,我認爲看起來有點像這樣:
{
"public": "dist",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
你需要移動指定的不同的密鑰(在這種情況下,public
,ignore
和rewrites
關鍵)到hosting
鍵,所以上面的代碼片段如下所示。
{
"hosting": {
"public": "dist",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
}
查看該鏈接瞭解Firebase hosting deployment configuration的更多信息。
感謝您的回答 –