Deploying ReactJS App to Firebase

Step 1: Install Firebase CLI globally

We can check the version by using the following command

Step 2: Login to the firebase account by using firebase CLI

If it is first time then we can navigate to login screen. If already logged in then it will show as “Already logged in “. If you want to login to other account or authenticate again we can use the following command.

firebase login --reauth

Step 3: Initialize firebase in your project’s root directory

firebase init

Then CLI will prompt the following questions.

After proceeding, it will show set of instructions. Navigate through them using Up/Down Arrow keys. Select Hosting by using spacebar.

Now select the project which you want to use. then it shows as “using project your_project_name”. After that you will see the following questions.

firebase.json code should be similar to the following. once check it in your project. if it is missing, rewrites key add it.

Step 4: Build your App using the following command

Step 5: Finally delpoy the App to firebase

One thought on “Deploying ReactJS App to Firebase”

Leave a comment