Create a project using the Angular CLI. Get more information here https://cli.angular.io/
Step 1: Create an Application
Run below cmd to build
ng build --prod
Step 2. Create a FireBase project and install the Firebase CLI
Open the Firebase console at https://console.firebase.google.com/ and create a new Firebase project.
To install the Firebase command-line tools, follow these steps:
npm install -g firebase-tools
Step 3. Deployment in FireBase
Run the below firebase cmd to log in:
firebase login
It will open a browser and ask you to authenticate. Log in to your Firebase account. After that, you can close the browser window. At the command line, you will receive a message stating that the login was successful.
Now run below cmd:
firebase init
First of all, you are asked which of the Firebase client features you want to use. You must select the "Hosting: Configure and Deploy Firebase Hosting Site" option. The Firebase client will then ask which folder to use for deployment. Type dist . This is important because this is the place where our assembly is stored.
The next question asks if this application is single-page and if it should rewrite all the URLs in index.html. In our case, we need to answer yes.
Last question: if Firebase should write index.html file. The answer to this question is no.
Now run below cmd to deploy:
firebase deploy
Firebase will provide a URL that you can use to access your application online.
source share