Skip to content

Commit 24570dc

Browse files
PrismPrinceAkryum
authored andcommitted
docs: Add Firebase deployment guide (vuejs#1760)
1 parent 5b61f8f commit 24570dc

File tree

1 file changed

+60
-1
lines changed

1 file changed

+60
-1
lines changed

docs/guide/deployment.md

Lines changed: 60 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,66 @@ See [vue-cli-plugin-s3-deploy](https://github.com/multiplegeorges/vue-cli-plugin
9292
9393
### Firebase
9494

95-
> TODO | Open to contribution.
95+
Create a new Firebase project on your [Firebase console](https://console.firebase.google.com). Please refer to this [documentation](https://firebase.google.com/docs/web/setup) on how to setup your project.
96+
97+
Make sure you have installed [firebase-tools](https://github.com/firebase/firebase-tools) globally:
98+
99+
```
100+
npm install -g firebase-tools
101+
```
102+
103+
From the root of your project, initialize `firebase` using the command:
104+
105+
```
106+
firebase init
107+
```
108+
109+
Firebase will ask some questions on how to setup your project.
110+
111+
- Choose which Firebase CLI features you want to setup your project. Make sure to select `hosting`.
112+
- Select the default Firebase project for your project.
113+
- Set your `public` directory to `dist` (or where your build's output is) which will be uploaded to Firebase Hosting.
114+
115+
```javascript
116+
// firebase.json
117+
118+
{
119+
"hosting": {
120+
"public": "app"
121+
}
122+
}
123+
```
124+
125+
- Select `yes` to configure your project as a single-page app. This will create an `index.html` and on your `dist` folder and configure your `hosting` information.
126+
127+
```javascript
128+
// firebase.json
129+
130+
{
131+
"hosting": {
132+
"rewrites": [
133+
{
134+
"source": "**",
135+
"destination": "/index.html"
136+
}
137+
]
138+
}
139+
}
140+
```
141+
142+
Run `npm run build` to build your project.
143+
144+
To deploy your project on Firebase Hosting, run the command:
145+
146+
```
147+
firebase deploy --only hosting
148+
```
149+
150+
If you want other Firebase CLI features you use on your project to be deployed, run `firebase deploy` without the `--only` option.
151+
152+
You can now access your project on `https://<YOUR-PROJECT-ID>.firebaseapp.com`.
153+
154+
Please refer on the [Firebase Documentation](https://firebase.google.com/docs/hosting/deploying) for more details.
96155

97156
### Now
98157

0 commit comments

Comments
 (0)