How to deploy React App to Firebase?

Steps to deploy the app to Firebase:

npm install -g firebase-tools
PS C:\Users\jayesh\Documents\React-September> npm install -g firebase-tools

C:\Users\jayesh\AppData\Roaming\npm\firebase -> C:\Users\jayesh\AppData\Roaming\npm\node_modules\firebase-tools\lib\bin\firebase.js

+ firebase-tools@8.10.0
updated 1 package in 32.755s
firebase login
PS C:\Users\jayesh\Documents\React-September\Venue Website Udemy\sep-venue-app> firebase login

Already logged in as <yourfirebaseaccount@gmail.com>
firebase init
PS C:\Users\jayesh\Documents\React-September\Venue Website Udemy\sep-venue-app> firebase init

You're about to initialize a Firebase project in this directory:

C:\Users\jayesh\Documents\React-September\Venue Website Udemy\sep-venue-app

? Are you ready to proceed? Yes
? Which Firebase CLI features do you want to set up for this folder? Press Space to select features, then Enter to confirm your choices. 
 ( ) Database: Deploy Firebase Realtime Database Rules
 ( ) Firestore: Deploy rules and create indexes for Firestore
 ( ) Functions: Configure and deploy Cloud Functions
>(*) Hosting: Configure and deploy Firebase Hosting sites
 ( ) Storage: Deploy Cloud Storage security rules
 ( ) Emulators: Set up local emulators for Firebase features
First, let's associate this project directory with a Firebase project.
You can create multiple project aliases by running firebase use --add,
but for now we'll just set up a default project.

i  .firebaserc already has a default project, using bhiyaoo-4b9fe.

=== Hosting Setup

Your public directory is the folder (relative to your project directory) that
will contain Hosting assets to be uploaded with firebase deploy. If you
have a build process for your assets, use your build's output directory.

? What do you want to use as your public directory? build
? What do you want to use as your public directory? build
? Configure as a single-page app (rewrite all urls to /index.html)? Yes
? File build/index.html already exists. Overwrite? (y/N) No

i  Writing configuration info to firebase.json...

+  Firebase initialization complete!
firebase deploy

PS C:\Users\jayesh\Documents\React-September\Venue Website Udemy\sep-venue-app> firebase deploy

=== Deploying to 'bhiyaoo-4b9fe'...

i  deploying hosting
i  hosting[bhiyaoo-4b9fe]: beginning deploy...
i  hosting[bhiyaoo-4b9fe]: found 20 files in build
+  hosting[bhiyaoo-4b9fe]: file upload complete
i  hosting[bhiyaoo-4b9fe]: finalizing version...
+  hosting[bhiyaoo-4b9fe]: version finalized
i  hosting[bhiyaoo-4b9fe]: releasing new version...
+  hosting[bhiyaoo-4b9fe]: release complete

+  Deploy complete!

Project Console: https://console.firebase.google.com/project/bhiyaoo-4b9fe/overview
Hosting URL: https://bhiyaoo-4b9fe.web.app

App will be hosted at URL provided by Firebase Hosting.

Reference – How to deploy a React application to Firebase by ROBIN WIERUCH – https://www.robinwieruch.de/firebase-deploy-react-js

Keep Hosting! 🎇

Published by Jayesh

I code and energize, loves sharing my journey.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s