From the course: Learning the Angular CLI

Deploying with the Angular CLI - Angular Tutorial

From the course: Learning the Angular CLI

Start my 1-month free trial

Deploying with the Angular CLI

- [Instructor] The Angular CLI allows you to deploy to third party services using one simple command: ng deploy. However, this only works for packages that have implemented deployment functionality to specific platforms. You can find a list of such packages at this URL. For our use case, we will be deploying to Firebase. Head over to the Firebase console at console.firebase.google.com. You will need to create a Firebase account. Let's go ahead and add a project. I will call my project CLI Deploy. Click continue, I don't want to use Google Analytics at this moment. And click on create project. Once that is done, go ahead and click continue. And head it back to your project directory. In your terminal, go ahead and run ng add @angular/fire. The command will go ahead and install any necessary dependencies. If this is your first time authenticating Firebase on your machine it will prompt you to authenticate with your Firebase account. And then, provide you with an authentication code that you can input here. Go ahead and select the Firebase project we just selected. In my case, it was CLI-deploy. Once that is done, we can see that it has modified our application in order to support deployment. Take another look at the package.json. Dependencies have been added. And also, heading over to angular.json, we can see there is now a deploy builder target. At your terminal, you can now run ng deploy. The CLI will first build your application. And then, Firebase will deploy your Angular App. Once that is done, it will provide you with a URL, where you can see your application live.

Contents