Address code review feedback for virtual mode

- Change bundleWarnings check from key length check to truthy check
- Add missing unsupported options: keepNames, emitDCEAnnotations,
  ignoreDCEAnnotations, bytecode, compile
- Pass define, drop, conditions to Bun.build since they are supported
- Fix readFile to use 'in' operator instead of truthy check (handles
  empty string outputs correctly)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Claude Bot
2026-01-18 09:55:29 +00:00
parent 07bdea0d03
commit 6dcd16657e

View File

@@ -600,7 +600,12 @@ function expectBundled(
if (snapshotSourceMap) unsupportedOptions.push("snapshotSourceMap");
if (expectExactFilesize) unsupportedOptions.push("expectExactFilesize");
if (onAfterApiBundle) unsupportedOptions.push("onAfterApiBundle");
if (bundleWarnings && Object.keys(bundleWarnings).length > 0) unsupportedOptions.push("bundleWarnings");
if (bundleWarnings) unsupportedOptions.push("bundleWarnings");
if (keepNames) unsupportedOptions.push("keepNames");
if (emitDCEAnnotations) unsupportedOptions.push("emitDCEAnnotations");
if (ignoreDCEAnnotations) unsupportedOptions.push("ignoreDCEAnnotations");
if (bytecode) unsupportedOptions.push("bytecode");
if (compile) unsupportedOptions.push("compile");
if (outdir) unsupportedOptions.push("outdir (use outfile instead)");
if (unsupportedOptions.length > 0) {
@@ -648,6 +653,9 @@ function expectBundled(
development: jsx.development,
}
: undefined,
define,
drop,
conditions,
});
if (!build.success) {
@@ -696,7 +704,7 @@ function expectBundled(
if (!normalizedFile.startsWith("/")) normalizedFile = "/" + normalizedFile;
// Try exact match first
if (outputCache[normalizedFile]) return outputCache[normalizedFile];
if (normalizedFile in outputCache) return outputCache[normalizedFile];
// For single-output builds, allow accessing the output by the configured outfile path
const outputs = Object.keys(outputCache);