esbuild plugin for optimizing Firebase Cloud Functions builds. Version 7.1.1 is the latest stable, released April 2026, requiring Node >=20 and esbuild >=0.17.0. It provides per-function entry point generation with tree shaking by executing the BFF entry point in a discovery mode, automatically reusing runtime config (functionDirectoryPath, searchGlob, etc.) so no duplicate configuration is needed. Published weekly, it supports buildFunctions() as the recommended API, along with manual discovery helpers and a logging plugin. Differentiates from vanilla esbuild by automating the discovery of Firebase function files and maintaining the output directory structure matching the runtime layout.
npm install better-firebase-functions-esbuildNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Builds per-function bundles using the BFF entry point config (ESM, Node 20, TypeScript).
Upgrade Node to >=14 or use v5.0.0 if stuck on older Node.
Migrate your project to ESM (type: module in package.json) and use import syntax.
Use buildFunctions() instead of the plugin for per-function output.
Wrap side effects in guards that skip during discovery mode (check process.env.BFF_DISCOVERY).
Switch to import syntax and set "type": "module" in your package.json, or use dynamic import().
Use import { bffEsbuildPlugin } from 'better-firebase-functions-esbuild'.Ensure your entry point invokes exportFunctions({ ... }) with correct functionDirectoryPath and searchGlob.