## Summary
- Fixes incorrect banner positioning when using `--banner` with
`--format=cjs` and `--target=bun`
- Ensures Bun-specific comments (`// @bun @bun-cjs`) appear before user
banner content
- Properly extracts and positions hashbangs from banner content
## Problem
When using `--banner` with `--format=cjs --target=bun`, the banner was
incorrectly placed before the `// @bun @bun-cjs` comment and CJS wrapper
function, breaking the module format that Bun expects.
## Solution
Implemented proper ordering:
1. **Hashbang** (from source file or extracted from banner if it starts
with `#!`)
2. **@bun comments** (e.g., `// @bun`, `// @bun @bun-cjs`, `// @bun
@bytecode`)
3. **CJS wrapper** `(function(exports, require, module, __filename,
__dirname) {`
4. **Banner content** (excluding any extracted hashbang)
## Test plan
- [x] Added comprehensive tests for banner positioning with CJS/ESM and
Bun target
- [x] Tests cover hashbang extraction from banners
- [x] Tests verify proper ordering with bytecode generation
- [x] All existing tests pass
🤖 Generated with [Claude Code](https://claude.ai/code)
---------
Co-authored-by: Claude <noreply@anthropic.com>
### What does this PR do?
### How did you verify your code works?
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Tests**
* Enabled multiple previously skipped bundler and esbuild test cases by
removing todo flags, increasing test suite coverage.
* Broadened cross-platform applicability by removing OS-specific gating
in certain tests, ensuring they run consistently across environments.
* Activated additional scenarios around resolve/load behavior, dead code
elimination, package.json handling, and extra edge cases.
* No impact on runtime behavior or public APIs; changes are limited to
test execution and reliability.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
### What does this PR do?
- Implements .onEnd
Fixes#22061
Once #22144 is merged, this also fixes:
Fixes#9862Fixes#20806
### How did you verify your code works?
Tests
---
TODO in a followup (#22144)
> ~~Make all entrypoints be called in onResolve~~
> ~~Fixes # 9862~~
> ~~Fixes # 20806~~
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* work on bundler
* a
* YAAAAYYAYAYAYYAYA
* get some more bundler tests working
* Update src/bundler/bundle_v2.zig
* rev
* ok
* i converted the cmakelists into LF
* personal review
* we didnt win
* okey they pass
* revert :(
* a
---------
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
* start this
* commit
* mark all failing tests as todo
* fasdfad
* bundler tests
* tests
* adjust failing tests to todo
* comment out some more tests
* png as test
* parse error logs
* clean up types
* remove --jsx-production. use NODE_ENV instead
* add define to js api
* add loaders to js api
* fixups
* sourcemap
* typo fix
* remove label, comment dir just for now
* test tweaks
* test work
* make optional enums actually optional.
allows `sourcemap: undefined`
* overload host ram test
* string tests
* tests
* test for 2815
* requested changes
* sort this list
* remove this test file now that it passes
* oops
* add --format
* finish ts tests
* doc typos related to define and loader