Saturday, May 15, 2021

Deploy React App to Firebase

1. Install Firebase CLI
    sudo npm install -g firebase-tools

2. Login to Firebase
    firebase login

3. Initiate your project
    firebase init
    (a) Select "Hosting"
    (b) Choose "Use an existing project" (if already created)
    (c) Choose the desired project
    (d) Enter "build" for public directory
    (e) Enter "No" for single-page app
    (f) Enter "N" to avoid overwritten index.html

4. Perform "npm run build"

5. Deploy with "firebase deploy"

Note: The above command is recommended to be executed in the React project directory

Reference: https://dzone.com/articles/react-apps-firebase

No comments:

Post a Comment