Initializing firebase CLI Features in an existing Firebase project directory

Jihang Liu picture Jihang Liu · Jun 24, 2018 · Viewed 8.3k times · Source

I am trying to add features "Hosting" into a Firebase project file which has already installed Functions.

So I want to know if I can do this with Firebase Init. or this will erase my existing firebase function. Is there anyway that I can do this without erasing my Firebase Functions.

And, in order to use firebase function, do I have to install Database as well? Or just Functions and Hosting.

Thank you.

Answer

Lucem picture Lucem · Nov 28, 2018

I feel that the accepted answer does not satisfy the question.

To initialize more features on the firebase project, type the command

firebase init [feature]

In my scenario, i had started firebase functions and needed to add the hosting, so my case was to type firebase init hosting. Firebase will proceed and start the feature with all configurations of the current project

enter image description here