From b27526b6ff4247c01736afc7c2bdf304907e25e5 Mon Sep 17 00:00:00 2001 From: James Hegedus Date: Sun, 30 Jul 2017 22:02:16 +1000 Subject: [PATCH] with-firebase-hosting update (#2683) * Fix link in with-firebase-hosting example * with-firebase-hosting example Update npm scripts & README --- examples/with-firebase-hosting/README.md | 8 +++----- examples/with-firebase-hosting/package.json | 1 - 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/examples/with-firebase-hosting/README.md b/examples/with-firebase-hosting/README.md index 3381704b..d420b9bc 100644 --- a/examples/with-firebase-hosting/README.md +++ b/examples/with-firebase-hosting/README.md @@ -21,9 +21,7 @@ Set up firebase: Install project: -```bash -npm install -``` +Each of the other commands pre-installs all dependencies Run Next.js development: @@ -46,10 +44,10 @@ npm run deploy ## The idea behind the example The goal is to host the Next.js app on Firebase Cloud Functions with Firebase Hosting rewrite rules so our app is served from our Firebase Hosting URL. Each individual `page` bundle is served in a new call to the Cloud Function which performs the initial server render. -This is based off of the work at https://github.com/geovanisouza92/serverless-firebase & https://github.com/jthegedus/firebase-functions-next-example as described [here](https://medium.com/jthegedus/) +This is based off of the work at https://github.com/geovanisouza92/serverless-firebase & https://github.com/jthegedus/firebase-functions-next-example as described [here](https://medium.com/@jthegedus/next-js-on-cloud-functions-for-firebase-with-firebase-hosting-7911465298f2). ## Important & Caveats * The empty `placeholder.html` file is so Firebase Hosting does not error on an empty `public/` folder and still hosts at the Firebase project URL. * `firebase.json` outlines the catchall rewrite rule for our Cloud Function. * Testing on Firebase locally requires a complete build of the Next.js app. `npm run serve` handles everything required. -* Any npm modules dependencies used in the Next.js app (`app/` folder) must also be installed as dependencies for the Cloud Functions project (`functions` folder). +* **Any npm modules dependencies used in the Next.js app (`app/` folder) must also be installed as dependencies for the Cloud Functions project (`functions` folder).** diff --git a/examples/with-firebase-hosting/package.json b/examples/with-firebase-hosting/package.json index 42776bc1..5d05e4be 100644 --- a/examples/with-firebase-hosting/package.json +++ b/examples/with-firebase-hosting/package.json @@ -3,7 +3,6 @@ "version": "1.0.0", "description": "Host Next.js SSR app on Firebase Cloud Functions with Firebase Hosting redirects.", "scripts": { - "install": "npm run build-all", "next": "npm run build-firebase && cd \"app\" && npm i && npm run dev", "preserve": "npm run build-all", "serve": "firebase serve",