Skip to content

Example repo for using local monorepo packages with Firebase Functions

Notifications You must be signed in to change notification settings

BenJackGill/demo-npm-bundle-local-deps

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

demo-npm-bundle-local-deps

Problem

Firebase Cloud Functions do not support a monorepo setup. The folder pointed to by firebase.json -> functions -> source is copied over in a container. The container is run on every Cloud Function cold start. When the container is run, the npm dependencies are installed. This means that we need a package.json in the folder. To support deterministic builds a package-lock.json should also be included. The dependencies are installed from the npm registry. Therefore local dependencies (other packages in the monorepo) are not supported.

Solution: bundle local dependencies

See packages/fnc/build.js.

Instructions:

  • npm i
  • npm run build:bundle -w @demo/fnc
  • Explore packages/fnc/dist folder

About

Example repo for using local monorepo packages with Firebase Functions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%