mirror of
https://github.com/oven-sh/bun
synced 2026-02-12 11:59:00 +00:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user