Host a Nuxt2 Universal app or site by combining Nuxt2.js with Firebase Cloud Functions and Hosting.
-
Obtain a Firebase Project ID to use for this project. See Overiew Here
-
Inside this directory, locate the file
.setup-firebasercand replace the textYOUR_FIREBASE_PROJECT_IDwith your Firebase Project ID.
We will now get everything setup and deployed in 3 commands:
Note: All of these commands are ran from the root directory
- Install Dependencies in all necessary directories and creates
.firebasercfrom.setup-firebaserc npm install -g firebase-tools
yarn setupyarn devyarn firebase:serveyarn deploy-
Create a Firebase Project using the Firebase Console.
-
Obtain the Firebase Project ID
- Server-side rendering with Firebase Hosting combined with Firebase Functions
- Firebase Hosting as our CDN for our publicPath (See nuxt.config.js)
-
You must have the Firebase CLI installed. If you don't have it install it with
npm install -g firebase-toolsand then configure it withfirebase login. -
If you have errors, make sure
firebase-toolsis up to date. I've experienced many problems that were resolved once I updated.
-
The root directory has a package.json file with several scripts that will be used to optimize and ease getting started and the workflow
-
ALL commands are ran from the root directory