如何更新我部署到Firebase Hosting的文件? [英] How to update a file that I deployed to Firebase Hosting?

查看:94
本文介绍了如何更新我部署到Firebase Hosting的文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将我的应用程序部署到Firebase时,我收到以下消息:

On deploying my app to Firebase, I am getting this message:

您看到此消息是因为您已经成功设置了Firebase Hosting.现在是时候构建非凡的东西了!

You're seeing this because you've successfully setup Firebase Hosting. Now it's time to go build something extraordinary!

我从上一篇文章中学到,我需要用自定义index.html替换默认的index.html.如何使用Firebase控制台执行此操作?

I learnt from a previous post that I need to replace the default index.html with my custom index.html. How do I do that using the Firebase Console?

推荐答案

您无法在Firebase控制台中更改托管文件.

You cannot change hosted files in the Firebase Console.

相反,应该在最初运行firebase deploy命令的本地副本上更改index.html.完成更改后,再次运行firebase deploy将网站的更新版本推送到Firebase Hosting.

Instead, you should change the index.html on your local copy where you initially ran the firebase deploy command. Once you're done with the changes, run firebase deploy again to push the updated version of your website to Firebase Hosting.

对于小的更改,运行firebase serve可能更快.这将启动本地Web服务器,以便您可以测试更改.您满意它们可以正常工作后,再次使用firebase deploy将它们发布到Firebase Hosting.

For small changes it is probably faster to run firebase serve. This spins up a local web server, so that you can test the changes. Once you're satisfied they work, publish them to Firebase Hosting with firebase deploy again.

更新:现在可以通过一些自定义脚本来实现.详情请参阅我的答案:通过CLI或其他方式将单个文件上传到Firebase托管而不删除现有文件吗?

Update: this is now possible through some custom scripting. See my answer here for details: Upload single file to firebase hosting via CLI or other without deleting existing ones?

这篇关于如何更新我部署到Firebase Hosting的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆