esbuild-exports-signature-repro
A minimal reproduction project showing a bug in how esbuild processes exported function signatures, built by running a script that bundles Preact.
What This Repository Does
This is a minimal reproduction case—a small example project designed to demonstrate a specific technical issue. The repository contains code that builds a JavaScript project and generates output files, then invites you to look at one particular output file to see the problem in action.
How It Works
The project includes a build script (build.js) that you run from the command line. When you execute it, the build process generates files in a dist folder, including a processed version of the Preact library (a lightweight alternative to React). The interesting part is in the resulting output file at dist/node_modules/preact/dist/preact.module.js—this file is where the issue being documented becomes visible.
Who This Is For and Why
This repository exists for developers who are troubleshooting problems with how esbuild (a fast JavaScript bundler and compiler) handles exported functions and their type signatures. If you're building a tool, library, or application that uses esbuild and you notice something seems wrong with how function exports are being processed, this repo gives you a concrete, reproducible example to study.
The creator set this up so others facing similar issues can see exactly how the problem manifests. You can run the build yourself, inspect the output, and compare it against what you'd expect. This kind of reproduction case is invaluable for debugging, discussing the issue with maintainers, or figuring out a workaround.
Where it fits
- Run the build script to reproduce a specific esbuild export-signature bug
- Inspect the generated dist/node_modules/preact output file to see the issue firsthand
- Use as evidence when reporting the bug to esbuild maintainers
- Compare the buggy output against expected behavior to find a workaround