Skip to content

Instantly share code, notes, and snippets.

@Vision-X
Last active March 16, 2019 22:45
Show Gist options
  • Select an option

  • Save Vision-X/8661c7f6ea5d791d983364dc9eba2afc to your computer and use it in GitHub Desktop.

Select an option

Save Vision-X/8661c7f6ea5d791d983364dc9eba2afc to your computer and use it in GitHub Desktop.

Deploying a React App to firebase!!!

NOTE: Before deployment, you will need to first run npm run build to create the build folder which will be used for deployment. You need to have this before starting these firebase commands

1) Install firebase CLI tools with this command:

  • npm install -g firebase-tools

2) In your terminal, run (if its your first time using firebase CLI):

  • firebase login and enter your credentials

3) Create a new project in the Firebase Console (website)

4) In your terminal, run:

  • firebase init

5) "Which CLI features do you want to setup for this folder? Press Space to select features, then Enter to confirm your choices"

  • use arrow keys, select HOSTING option with spacebar. Press ENTER.

6) "What do you want to use as your public directory? (public)"

  • build, Press Enter

7) "Configure as a single-page app (rewrite all urls to /index.html)"

  • Y, Press ENTER

8) "File build/index.html already exists. Overwrite?"

  • N, Press ENTER

9) Should see success message of "Firebase initialization complete!"

10) Last command in your termnial:

  • firebase deploy

If everything worked... it should upload everything and then provide a URL to your project console and the deployed URL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment