- Setup Environment for the Firebase deployment
- Install Firebase CLI:
npm i -g firebase-toolsoryarn 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 logincommand in your Terminal/CMD/Powershell. - Type
firebase init. - Select the project by using the arrow keys.
- Then Select the
Firebase Hostingby using Spacebar and arrow key. - Click
Nofor Single page web app. - Type
dist. - Some by default file will be created successfully.
- Run locally
firebase serveornpm run serveoryarn serve
- Update Firebase.json file
{ "hosting": { "public": "dist", "rewrites": [ { "source": "**", "destination": "/index.html" } ], "ignore": [ "firebase.json", "**/.*", "**/node_modules/**" ] } }
- Build and deploy
firebase deployornpm run deployoryarn deploy
- The URL to your live site is listed in the output.
- Enjoy