next-to-firebase

0.3.2 • Public • Published

Next.js + Firebase

npm ci

Build an optimized Firebase application from a Next.js serverless-build.

All static pages are hosted. Pages that need server-side-rendering will be added as a Function. This insures a optimal way of hosting your application.

Installation

npm install --save-dev next-to-firebase

Usage

Using the command line:

next-to-firebase -n src/app -o dist

In code:

import { run } from 'next-to-firebase'
run(rootDir, relativeNextAppDir, relativeDistDir)

Result:

project/
  dist/            < Firebase application will be constructed here
  src/
    app/           < Next.Js applications
    functions/
      index.js     < Generic index.js where `//_exports_`-string gets replaced with page-functions
  firebase.json    < Generic firebase.json where `"_rewrites_"`-string gets replaced with the generated routes
  package.json     < Will get copied to functions-directory in dist so dependencies and engine will be managed here

For more info see the examples-directory.

Contributing

Contributions are more than welcome!

Package Sidebar

Install

npm i next-to-firebase

Weekly Downloads

3

Version

0.3.2

License

MIT

Unpacked Size

22.6 kB

Total Files

17

Last publish

Collaborators

  • lowiehuyghe