Files
bun.sh/test/bundler
Claude Bot ea79a84b9a feat(bundler): Auto-bundle workers referenced in new Worker() calls
This adds automatic detection and bundling of Worker files when they are
referenced via `new Worker("./path.ts")` with a string literal.

Changes:
- Add ImportKind.new_worker to track worker imports separately
- Detect `new Worker(path)` pattern in the AST visitor (visitExpr.zig)
- Store worker_import_record_index in E.New AST node
- Add worker files as entry points in LinkerGraph.zig
- Rewrite worker paths to bundled chunk paths in printer (js_printer.zig)
- Handle worker path rewriting even without code_splitting

Worker detection is limited to:
1. Global unbound Worker (Bun's Web Worker API)
2. Worker imported from 'node:worker_threads' or 'worker_threads'

User-defined classes named Worker are NOT detected to avoid false positives.

This allows workers to be automatically bundled without needing explicit
entryPointsRaw configuration.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-28 03:26:26 +00:00
..
2024-06-27 14:56:07 -07:00
2025-11-19 20:31:37 -08:00