Files
bun.sh/test/regression/issue
Claude Bot 5ba168a554 Allow onLoad plugins to return null/undefined to fallback to filesystem
Fixes #5303

Previously, when a plugin's onLoad callback returned null or undefined,
Bun would throw a TypeError: "onLoad() expects an object returned".

This change allows plugins to return null/undefined to signal "no match"
and fallback to the default loading mechanism (filesystem or next plugin),
matching the behavior of onResolve.

This is useful for:
- Conditional file handling (only process certain files)
- Plugin chaining (let another plugin handle it)
- Leveraging Bun's built-in loading for some files

The implementation follows the same pattern as onResolve:
- null/undefined -> continue to next plugin/fallback
- Other non-objects (boolean, number, string) -> throw TypeError
- Objects -> validate and process

Note: In Bun.build() API (BundlerPlugin.ts), ALL non-object values
fallback (including primitives like true, 42, "string"), but the C++
layer used by runtime plugins follows stricter validation like onResolve.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 07:50:25 +00:00
..
2025-08-06 06:44:46 -07:00
2025-01-28 17:23:57 -08:00
2025-06-03 13:23:12 -07:00
2025-06-03 23:41:37 -07:00
2025-01-17 22:08:07 -08:00
2024-06-14 01:50:36 -07:00
2025-03-03 21:38:05 -08:00
2025-05-26 21:18:22 -07:00
2025-07-03 01:06:22 -07:00
2025-07-23 22:31:42 -07:00
2025-10-20 14:07:31 -07:00
2025-07-20 23:02:10 -07:00