Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Initializing firebase CLI Features in an existing Firebase project directory

Tags:

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.

like image 658
Jihang Liu Avatar asked Jun 24 '18 15:06

Jihang Liu


People also ask

Which Firebase CLI features do you want to set up for this folder?

What Firebase CLI features do you want to set up for this folder: There are two option 1)Realtime Database and Firebase Hosting. So we need to select Firebase hosting option.

Which command is used to setup Firebase hosting in local project using CLI?

The firebase init command creates a firebase. json configuration file in the root of your project directory. The firebase. json file is required to deploy assets with the Firebase CLI because it specifies which files and settings from your project directory are deployed to your Firebase project.

How do I know if Firebase command line is installed?

Run firebase tools --version to check version. And as per the prompt, run npm install -g firebase-tools to update. You're right.

What is the Firebase CLI NPM module?

Firebase CLI. The Firebase Command Line Interface (CLI) Tools can be used to test, manage, and deploy your Firebase project from the command line. Deploy code and assets to your Firebase projects. Run a local web server for your Firebase Hosting site.


2 Answers

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

like image 74
Lucem Avatar answered Oct 07 '22 07:10

Lucem


The Firebase CLI will not overwrite files unless it asks you to. For each configuration file that it might overwrite, it will ask for confirmation. You can add new products to you project configuration with no problem. You can use each product independently.

You can verify all this for yourself by initializing a new project folder and testing it out your concerns separately from your existing project folder. As long as you don't deploy anything, no changes will be made to your project hosted in Firebase.

like image 21
Doug Stevenson Avatar answered Oct 07 '22 09:10

Doug Stevenson