theusual
theusual

Reputation: 791

How to update a file that I deployed to Firebase Hosting?

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

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

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?

Upvotes: 20

Views: 58186

Answers (4)

Harshit Malik
Harshit Malik

Reputation: 31

Simply make the changes you want to and then type

npm run build

After this spin the server again using

firebase deploy

The changes you want will be updated. You can also see the updated changes with the command

firebase serve

and then run firebase deploy when you're satisfied.

Upvotes: 3

Henry2
Henry2

Reputation: 409

Its a simple solution. This message is caused by the index.html file in your public folder being replaced with the index.html file provided by firebase. All you have to do is navigate to the directory of your web app folder on your terminal and type in $ rm .firebaserc then $ firebase init after you've completed the firebase initialization, replace the new index.html file with the one inside the public folder and then type $ firebase deploy

Upvotes: 0

Frank van Puffelen
Frank van Puffelen

Reputation: 599091

You cannot change hosted files in the Firebase Console.

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.

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.

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?

Upvotes: 57

Asang Borkar
Asang Borkar

Reputation: 1

First of all Update all the coding and assets files in your local system then,

1) Go to the directory in the terminal by typing $ cd {add your directory} 2) Login on your terminal console by typing $ firebase login in the terminal 3) after login write $ firebase deploy

then, go to Hosting Section in your Firebase Console and delete the previously deployed files by deleting the previously added section in {Poject_Name} release history,

like this enter image description here

Upvotes: 0

Related Questions