Skip to content

Commit 97d8e07

Browse files
authoredAug 30, 2020
[Example] fix with-firebase-hosting (#16577)
1 parent 694ccc7 commit 97d8e07

File tree

3 files changed

+4
-11
lines changed

3 files changed

+4
-11
lines changed
 

‎examples/with-firebase-hosting/README.md

+1-6
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ Then you can create components and pages in `.tsx` or `.ts`
7070
- The empty `public/.gitignore` file is to ensure `public/` dir exists as it is required for Firebase Hosting. It is [configured](firebase.json:#L4) (by [default](https://firebase.google.com/docs/hosting/full-config#ignore)) that dotfiles (`public/.*`) are ignored from bein publicly served.
7171
- The Cloud Function is named `nextjsFunc` (changeable in [firebaseFunctions.js](firebaseFunctions.js#L16) and [firebase.json](firebase.json#L8)).
7272
- `public/*` files are statically served through [Firebase hosting](https://firebase.google.com/docs/hosting/full-config#public), not through [NextJs server](https://nextjs.org/docs/basic-features/static-file-serving).
73-
- Specifying [`"engines": {"node": "10"}`](package.json#L5-L7) in `package.json` is required and the [latest supported](https://firebase.google.com/docs/functions/manage-functions#set_nodejs_version) by firebase functions.
7473

7574
#### Customization
7675

@@ -82,11 +81,7 @@ The crucial files for the setup:
8281
- `firebase.json`
8382
- `firebaseFunctions.js`
8483
- `src/next.config.js`
85-
- In `package.json`: `firebase-*` packages and `engines` field
86-
87-
## Caveat
88-
89-
Because firebase functions require `"engines": {"node": "10"}` (or 8) to be specified (in `package.json`), if you are using `yarn` (instead of `npm`), you will need to add flag [`--ignore-engines`](https://classic.yarnpkg.com/en/docs/cli/install/#toc-yarn-install-ignore-engines).
84+
- In `package.json`: `firebase-*` packages.
9085

9186
## References
9287

‎examples/with-firebase-hosting/firebase.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"predeploy": [
1515
"npm --prefix \"$PROJECT_DIR\" install",
1616
"npm --prefix \"$PROJECT_DIR\" run build"
17-
]
17+
],
18+
"runtime": "nodejs10"
1819
}
1920
}

‎examples/with-firebase-hosting/package.json

+1-4
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
"name": "with-firebase-hosting",
33
"version": "5.0.0",
44
"description": "Host Next.js SSR app on Firebase Cloud Functions with Firebase Hosting redirects.",
5-
"engines": {
6-
"node": "10"
7-
},
85
"main": "firebaseFunctions.js",
96
"scripts": {
107
"dev": "next src/",
@@ -24,6 +21,6 @@
2421
},
2522
"devDependencies": {
2623
"firebase-functions-test": "^0.1.6",
27-
"firebase-tools": "^8.0.1"
24+
"firebase-tools": "^8.6.0"
2825
}
2926
}

0 commit comments

Comments
 (0)
Please sign in to comment.