You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -102,7 +102,7 @@ Firebase offers two cloud-based, client-accessible database solutions that suppo
102
102
103
103
> Firebase Hosting is production-grade web content hosting for developers. With Hosting, you can quickly and easily deploy web apps and static content to a global content delivery network (CDN) with a single command.
104
104
105
-
-[Deploy your Angular application on Firebase Hosting](docs/deploying-angularfire-to-firebase.md)
105
+
-[Deploy your application on Firebase Hosting](docs/deploy/getting-started.md)
In this guide, we'll look at how to use `@angular/fire` to automatically deploy an Angular application to Firebase hosting by using the Angular CLI.
4
+
5
+
## Step 1: add `@angular/fire` to your project
6
+
7
+
First, you need to add the `@angular/fire` package to your project. In your Angular CLI project run:
8
+
9
+
```shell
10
+
ng add @angular/fire
11
+
```
12
+
13
+
*Note that the command above assumes you have global Angular CLI installed. To install Angular CLI globally run `npm i -g @angular/cli`.*
14
+
15
+
The command above will trigger the `@angular/fire``ng-add` schematics. The schematics will open a web browser and guide you through the Firebase authentication flow (if you're not signed in already). After you authenticate, you'll see a prompt to select a Firebase hosting project.
16
+
17
+
The schematics will do the following:
18
+
19
+
- Add `@angular/fire` to your list of dependencies
20
+
- Create `firebase.json`, `.firebaserc` files in the root of your workspace. You can use them to configure your firebase hosting deployment. Find more about them [here](https://firebase.google.com/docs/hosting/full-config)
21
+
- Update your workspace file (`angular.json`) by inserting the `deploy` builder
22
+
23
+
In the end, your `angular.json` project will look like below:
If you want to add deployment capabilities to a different project in your workspace, you can run:
46
+
47
+
```
48
+
ng add @angular/fire --project=[PROJECT_NAME]
49
+
```
50
+
51
+
## Step 2: deploying the project
52
+
53
+
As the second step, to deploy your project run:
54
+
55
+
```
56
+
ng run [ANGULAR_PROJECT_NAME]:deploy
57
+
```
58
+
59
+
The command above will trigger:
60
+
61
+
1. Production build of your application
62
+
2. Deployment of the produced assets to the firebase hosting project you selected during `ng add`
63
+
64
+
## Step 3: customization
65
+
66
+
To customize the deployment flow, you can use the configuration files you're already familiar with from `firebase-tools`. You can find more in the [firebase documentation](https://firebase.google.com/docs/hosting/full-config).
0 commit comments