Commit 06d4528
committed
fix(build/externals): propagate bundle failures instead of silent stubs
`bundlePackage` caught every error, wrote a `throw new Error(...)` stub
to the output path, and returned `undefined`. Consequences:
- The orchestrator's `try { await bundlePackage(...) } catch` blocks
for optional packages were unreachable — the outer catch never fired.
- The build completed "successfully" even when bundles failed. The
"Failed to bundle X" log line scrolled past amid the rest of the
output, and downstream consumers didn't learn anything was wrong
until they `require()`'d the package at runtime and hit the stub's
`throw new Error('Failed to bundle X')`.
Rethrows the error. Optional-package try/catch now works as intended,
and non-optional failures bubble up to `buildExternals` → `main.mts` so
the build exits non-zero.1 parent ccf9d2b commit 06d4528
1 file changed
Lines changed: 5 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
124 | 122 | | |
125 | 123 | | |
0 commit comments