This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ # make sure you're in functions directory | |
$ # move to <proj> directory | |
$ cd ../ | |
$ firebase init hosting | |
$ # all answers should be default | |
- ? What do you want to use as your public directory? | |
- ? Configure as a single-page app (rewrite all urls to /index.html)? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const functions = require('firebase-functions') | |
const express = require('express') | |
const { Nuxt } = require('nuxt') | |
const app = express() | |
const config = { | |
dev: false, | |
buildDir: 'nuxt', | |
build: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ # make sure you're in functions directory | |
$ echo '' > index.js && vi index.js |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
buildDir: '../functions/nuxt', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ # add the packages | |
$ yarn | |
$ # install express | |
$ yarn add express | |
$ # move to src directory, build the app and go back to functions directory | |
$ cd ../src/ && yarn build && cd ../functions/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ # move to functons directory | |
$ cd functions | |
$ # edit the file | |
$ vi package.json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ # edit the file | |
$ vi src/nuxt.config.js |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ # add the project | |
$ firebase use --add |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ # move to <proj> directory | |
$ cd <proj> | |
$ # install firebase-tools | |
$ sudo npm i -g firebase-tools | |
$ # login | |
$ firebase login | |
$ # initialize Cloud Functions | |
$ firebase init functions | |
$ # [create a new project] | |
- ? Select a default Firebase project for this directory: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vendor: ['axios', 'babel-polyfill'], |