- Setup Environment for the Firebase deployment
- Install Firebase CLI:
npm i -g firebase-tools
oryarn global add firebase-tools
- Install Firebase CLI:
- Create Firebase account and login into Firebase CLI:
firebase login
- Open Terminal/CMD/Powershell in your dir.
- Now type
firebase login
command in your Terminal/CMD/Powershell. - Type
firebase init
. - Select the project by using the arrow keys.
- Then Select the
Firebase Hosting
by using Spacebar and arrow key. - Click
No
for Single page web app. - Type
dist
. - Some by default file will be created successfully.
- Run locally
firebase serve
ornpm run serve
oryarn serve
- Update Firebase.json file
{ "hosting": { "public": "dist", "rewrites": [ { "source": "**", "destination": "/index.html" } ], "ignore": [ "firebase.json", "**/.*", "**/node_modules/**" ] } }
- Build and deploy
firebase deploy
ornpm run deploy
oryarn deploy
- The URL to your live site is listed in the output.
- Enjoy