Overview of Egg Bundler
nextEgg Bundler (@eggjs/egg-bundler) is a developer tooling package used to produce deployable CommonJS artifacts from Egg applications. It serves two primary purposes:
- Node Startup Snapshots: Bundling applications for optimized Node.js startup.
- Tegg Standalone Service Workers: Bundling for Cloudflare Workers targets via
StandaloneWorkerBundler.
Important Constraints:
- The underlying engine (
PackRunner) uses@utoo/pack(powered by Turbopack). - The output is strictly CommonJS. There is no ESM output.
- In single-file (
export) mode, the output is an IIFE that ends withmodule.exports = factory(). This allows a Noderequire()to expose the entry'sexport defaultor named exports.