next-to-firebase
v0.3.2
Published
Next.js + Firebase
Downloads
39
Maintainers
Readme
Next.js + Firebase
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!