Firebase is awesome. You can build a functional application in React + Firebase soon. Here is a tutorial for deploying your React App to Firebase Hosting.
Install the Firebase CLI globally to your node modules:
$ npm install -g firebase-tools
Next associate the Firebase CLI with a Firebase account:
$ firebase login
And then, you have to connect Firebase hosting with your React app:
$ firebase init
Choose the Hosting options.
Which Firebase CLI features do you want to set up for this folder? Press Space to select features, then Enter to confirm your choices.
$ Hosting
Select a default Firebase project for this directory
$ <your-firebase-app-name>
What do you want to use as your public directory?
$ public
Configure as a single-page app (rewrite all urls to /index.html)?
$ Yes
File public/index.html already exists. Overwrite?
$ No
Done!
You have to update firebase.json like below:
{
  "hosting": {
    "public": "build",
    "ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
    "rewrites": [
      {
        "source": "**",
        "destination": "/index.html"
      }
    ]
  }
}
public should be build.
And you should delete .firebases folder every time you deploy.
    
Top comments (0)