Analysis updated 2026-08-03 · repo last pushed 2025-04-25
Check whether your define placeholders are global or local to understand why some values aren't being replaced.
Compare how Rolldown, esbuild, and Rollup handle the same define substitution to pick the right bundler.
Use this as a reproducible example when reporting a bug or design decision to the Rolldown team.
| brillout/rolldown-define-testbed | 00kaku/gallery-slider-block | 0verflowme/weirdhta | |
|---|---|---|---|
| Language | JavaScript | JavaScript | JavaScript |
| Last pushed | 2025-04-25 | 2021-05-19 | 2022-06-16 |
| Maintenance | Stale | Dormant | Dormant |
| Setup difficulty | easy | easy | moderate |
| Complexity | 2/5 | 2/5 | 2/5 |
| Audience | developer | general | developer |
Figures from each repo's GitHub metadata at analysis time.
This repository is a small test project that demonstrates a specific behavior in Rolldown, a JavaScript bundling tool. It shows that Rolldown's "define" option, which lets developers swap in fixed values during the build process, only works on global variables, not local ones. When developers build a web app, they use tools called bundlers to combine and optimize their code. These bundlers often have a "define" feature that works like a find-and-replace: you tell it to swap a placeholder like "API_URL" with an actual web address when the code is compiled. This project sets up a simple demonstration showing that if you try to use this feature on a local variable (one that only exists inside a specific function), Rolldown won't replace it. It only performs the replacement on global variables that are accessible throughout the entire codebase. The person who would use this is a developer trying to understand why their code isn't behaving as expected when using Rolldown. For example, if a developer sets up a build process expecting certain values to be automatically swapped in, but notices some of them aren't changing, this project helps explain why. It serves as a concrete, reproducible example that a developer could use to report the behavior, verify whether it's a bug or an intentional design choice, or compare how other tools handle the same scenario. To help with that comparison, the project includes the same test case set up with a few other popular bundling tools. This lets a developer see side-by-side whether tools like esbuild or Rollup handle the same situation differently, making it easier to understand the quirks of each tool before committing to one for a real project.
A test project showing that Rolldown's define option only replaces global variables, not local ones. It includes side-by-side comparisons with other bundlers like esbuild and Rollup.
Mainly JavaScript. The stack also includes JavaScript, Rolldown, esbuild.
Stale — no commits in 1-2 years (last push 2025-04-25).
Setup difficulty is rated easy, with roughly 5min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.