DEV Community

Cover image for How to deploy/Host React project on firebase
Abod Micheal (he/him)
Abod Micheal (he/him)

Posted on

How to deploy/Host React project on firebase

$ npm install -g firebase-tools

$ firebase login

$ firebase init

◯ 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
(use space to select)
◯ Storage: Deploy Cloud Storage security rules

? Select a default Firebase project for this directory:

-> react-project-abod (react-project)

i Using project react-project (react-project)

? 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 public/index.html already exists. Overwrite? No

$ npm run build

$ firebase deploy

Enter fullscreen mode Exit fullscreen mode

Top comments (1)

Collapse
 
shadowtime2000 profile image
shadowtime2000

Could you use the markdown code block fencing? It makes it easier to read and it colors syntax

$ npm install -g firebase-tools
$ firebase login
$ firebase init