Repository navigation
bun build --no-bundle: write output files when --outdir is set - #35644
Conversation
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 12 minutes Limit details: You’ve used all 1 included review currently available under your plan. You completed 70 included PR reviews in the past 7 days; at that activity level, included reviews refill at 1 review per hour. Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (9)
Comment |
|
Found 2 issues this PR may fix:
🤖 Generated with Claude Code |
|
Updated 12:05 AM PT - Aug 13th, 2026
❌ @robobun, your commit 653b010 has some failures in 🧪 To try this PR locally: bunx bun-pr 35644That installs a local version of the PR into your bun-35644 --bun |
|
This PR may be a duplicate of:
🤖 Generated with Claude Code |
|
Re #31650: same underlying bug, different fix. That PR post-processes the output files in |
There was a problem hiding this comment.
LGTM — 02cd1a0 addresses the single-entry + --root edge case I flagged: make_path now runs unconditionally on dirname(rel_path) (guarded against ""/.), and the fourth test locks it in.
What was reviewed:
- Traced
write_to_disk's other callers (build_command.rs,bake/production.rs) — the movedmake_pathis idempotentmkdir -pand the new!= b"."guard only skips a no-op, so full-bundle and bake paths are unaffected. - Confirmed
build_with_resolve_result_eageris only reached from thetransform_onlypath, so the newdest_pathcomputation doesn't touch the bundler proper. - Extension mapping goes through
options.out_extensions/preserve_extensionsrather than hardcoding.js, so CSS and non-JS loaders keep their extensions.
Extended reasoning...
Overview
Two-part fix for bun build --no-bundle --outdir writing to an empty dest_path (#9859, #5206, #10370):
src/bundler/transpiler.rs: inbuild_with_resolve_result_eager(the--no-bundletransform-only path), populateoutput_file.dest_pathfromrelative(root_dir, source_path)with the extension remapped viaoptions.out_extensions. Previously left asBox::default()fromzero_value().src/bundler/OutputFile.rs: inwrite_to_disk, hoist thedirname+make_pathstep outside thedest_path.len() > root_dir_path.len()gate so the parent directory is created even whenlongest_common_pathreturns the sole path verbatim (single entry + explicit--root). Adds aparent != b"."guard.
Four new tests in test/bundler/cli.test.ts cover single entry, multiple entries, nested structure, and single nested entry with --root=..
Security risks
None. The change constructs an output path from the user's own entry-point path relative to the user's own --root, then mkdir -ps under the user's own --outdir fd via openat-relative operations. No untrusted input.
Level of scrutiny
Medium — this is bundler CLI output-path plumbing, not runtime hot path or memory-sensitive code. The OutputFile.rs change touches a function shared with the full bundler and bake, so I traced those callers: bake/production.rs passes root_dir_path = b".", so any real dest_path already passed the length gate and the behavior there is unchanged (minus the new .-skip, which avoids a redundant mkdirat(fd, ".")). build_command.rs's full-bundle path likewise already hit the gate for typical ./chunk-*.js outputs. make_path = mkdir_recursive_at, which is idempotent, so the newly-covered case (length gate false) is strictly additive.
Other factors
- My earlier review flagged the single-entry +
--rootgap; 02cd1a0 implements exactly the first suggested fix (drop thelen()gate onmake_path, computedirnameon whateverrel_pathended up as) plus the requested fourth test. Verified the trace: for that test,from_path == dest_path == "./src/nested/deep.js", length gate is false,dirname→"./src/nested",make_pathcreatesdist/src/nested/, write succeeds. build_with_resolve_result_eageris only reached from thetransform_only = truepath (transpiler.rs:2760), so the newdest_pathblock does not run for normalbun build.- Tests follow harness conventions (
tempDir,bunEnv, concurrentPromise.allon stdout/stderr/exited, stderr asserted before exitCode,describe.concurrentfor independent subprocess tests). - There is an open competing PR (#31650) taking a different approach; the author explained why this one is preferable (honours
out_extensions/preserve_extensionsinstead of hardcoding.js). That's a maintainer call at merge time, not a correctness concern with this PR.
There was a problem hiding this comment.
LGTM — the follow-up commit addresses the single-entry + --root gap I flagged by moving make_path outside the length gate, and the fourth test locks it in.
What was reviewed:
dest_pathcomputation inbuild_with_resolve_result_eager— mirrors the bundler's asset-path logic (relative toroot_dir, extension viaout_extensions, honourspreserve_extensions).- Traced the other
write_to_diskcallers (bake/production.rspassesb".",build_command.rspasseslongest_common_path) — movingmake_pathoutside the gate is at worst a no-opmkdir -pfor them; the addedparent != b"."check avoids the redundant call for flat outputs. - Four tests cover single/multi entry, nested structure, and single-nested +
--root; all drain pipes concurrently and assert file contents, not just existence.
Extended reasoning...
Overview
Fixes bun build --no-bundle --outdir failing with ENOENT: failed to write file '""' (#9859, #5206, #10370). Two changes:
transpiler.rs(build_with_resolve_result_eager): computedest_pathfor the transform-only path — relative tooptions.root_dir, extension mapped throughoptions.out_extensions(or preserved whenpreserve_extensionsis set), prefixed with./to match bundler output-path shape.OutputFile.rs(write_to_disk): move themake_path(dirname(rel_path))call outside thedest_path.len() > root_dir_path.len()gate so the parent directory is created even whenlongest_common_pathreturns the sole path verbatim (single entry + explicit--root). Addedparent != b"."to skip the trivial case.
Four new tests in test/bundler/cli.test.ts.
Security risks
None. This is output-path computation for a build command using paths the user supplied on the CLI; no untrusted input, no auth/crypto/network surface.
Level of scrutiny
Medium. write_to_disk is shared with the full bundler and bake/production.rs, so the second change needed tracing across all callers:
- bake passes
root_dir_path = b".", sodest_path.len() > 1was always true and therelative()+make_pathpath already ran — no behavioral change. - build_command.rs (full bundler) passes
from_path = longest_common_path(all_paths). When the length gate is false (single output), the new code runsdirnameondest_pathdirectly; for a flat./foo.jsthat yields.(filtered), and for a nested path it creates the parent — which is exactly the case the original gate was silently skipping.make_pathismkdir -p-style, so re-creating an existing directory is a no-op.
The dest_path computation itself is scoped to build_with_resolve_result_eager, whose only in-tree caller is the --no-bundle transform loop.
Other factors
- My previous review flagged the single-entry +
--rootgap; commit 02cd1a0 implemented the suggested fix (option 1: unconditionaldirname+make_pathinwrite_to_disk) and added the fourth test. That thread is resolved. - Tests follow harness conventions:
tempDir,bunEnv/bunExe,describe.concurrentfor independent subprocess spawns, concurrent pipe draining, stderr asserted before exitCode, output contents asserted (not just existence),path.joinfor the nested-path stdout assertion so it holds on Windows. - The PR takes the correct-layer approach vs. #31650 (which post-processes in
build_command.rsand hardcodes.js, breaking CSS entry points). The author already noted the trade-off in-thread; closing #31650 is a maintainer call outside this review's scope. - No bugs surfaced by the bug-hunting pass this run.
There was a problem hiding this comment.
Beyond the inline [hash] note, I also checked the other three write_to_disk callers (build_command.rs and two in bake/production.rs) for regressions from the new is_absolute gate + unconditional make_path — bundler dest_paths are always relative (enforced by the debug_assert at build_command.rs:1057), so rel_path resolves the same as before and the extra make_path(dirname) is a no-op or idempotent mkdir. The _.._ handling in the escape test is the existing sanitize_parent_dirs=true path in path_template_print, not new logic.
Extended reasoning...
The prior round's single-entry+--root gap was addressed in 02cd1a0/31080d6 by moving make_path outside the length gate and guarding relative() on is_absolute. Since write_to_disk is shared with the full bundler and bake production paths, I traced all four call sites to confirm the refactor is behavior-preserving for relative dest_paths (which the existing debug_assert guarantees for the bundler). Deferring approval given the shared-helper change, the competing approach in #31650 that a maintainer should weigh, and CI not yet green on the latest commit.
There was a problem hiding this comment.
All five rounds of prior feedback are now addressed (or explicitly declined with reasoning for the collision check). No new issues this round. This isn't a mechanical change though — ~70 lines of new PathTemplate/extension-mapping logic plus a shared-code tweak to OutputFile::write_to_disk — so worth a maintainer glance on the overall approach.
What was reviewed:
- Traced the
write_to_diskchange against its other callers (build_command.rsfull-bundler path andbake/production.rswithroot_dir_path = b".") — both pass relativedest_paths, so the newis_absolutegate is a no-op there and unconditionalmake_pathis strictly safer. - Confirmed
template.print(_, true)is thesanitize_parent_dirsflag, matching the_.._/escape test. - Verified the CSS-arm
sizefix and theValue::Copy→op.pathnamedest_path both landed as described.
Extended reasoning...
Overview
Fixes bun build --no-bundle --outdir, which previously wrote nothing (ENOENT on an empty dest_path). Two source changes: (1) transpiler.rs gains a ~55-line block after the loader match in build_with_resolve_result_eager that computes dest_path via options::PathTemplate (relative-to-root, out_extensions lookup with .js fallback for JS-emitting loaders / source ext for CSS, [dir]/[name].[ext] or entry_naming, [target]/[hash] placeholders filled, .. sanitised, posix separators); Value::Copy outputs mirror op.pathname instead. The CSS arm now also sets output_file.size. (2) OutputFile::write_to_disk only relativises when dest_path is absolute, and always creates the parent dir when dirname(rel_path) is non-empty/non-.. Eight new tests in test/bundler/cli.test.ts.
Security risks
None. Path handling is confined to build-tool output under a user-supplied --outdir; the sanitize_parent_dirs=true flag on template.print maps .. → _.._ so out-of-root entries land inside --outdir (covered by the last test). No network, auth, or untrusted-input parsing.
Level of scrutiny
Medium. The --no-bundle --outdir path itself was 100% broken before, so there's nothing to regress there. The higher-scrutiny piece is the shared write_to_disk change, which is also reached by the full bundler and by bake/production.rs. I traced both: full-bundler dest_paths come from the same PathTemplate machinery and are always ./… relative, so the new is_absolute gate is false and rel_path stays as-is (previously it went through relative(from_path, dest_path) on two relative paths, which produced an equivalent openat target). bake passes root_dir_path = b".", same analysis. Moving make_path outside the length gate only adds a mkdir where one might previously have been skipped — strictly safer.
Other factors
This PR has been through five iterative review rounds; each finding (single-entry+--root mkdir, [hash] placeholder, data-loader .js extension, Value::Copy dest_path/summary mismatch, CSS size=0) was fixed with a corresponding test. The one declined item — a duplicate-dest_path collision error mirroring generateChunksInParallel.rs:407 — is reasonably scoped out (needs the CLI write loop's view of all outputs, and the pre-PR behaviour was total failure). Deferring rather than approving because the change is not mechanical: it introduces the --no-bundle naming semantics (template reuse, .js fallback for data loaders, ContentHasher for [hash]) and touches a shared write path, which merits a maintainer sign-off on the approach even though I found nothing wrong with it.
|
Reproduced with CI on 653b010 (build 94060): every test job that ran passed (the annotated tests are unrelated retries that went green). The build is marked failed only because two darwin 26 aarch64 test shards expired waiting for an agent. |
There was a problem hiding this comment.
No new findings this run — the earlier review rounds have all been addressed. I'm not auto-approving because this adds ~60 lines of new output-path logic plus a behaviour change to the shared OutputFile::write_to_disk (also used by bake production and the full-bundler write loop), and there's a competing approach in #31650; a maintainer should confirm which one lands.
What was reviewed:
write_to_diskchange is safe for the other two callers —bake/production.rspassesroot_dir_path = b"."and relativedest_paths, sois_absoluteis false andmake_pathstill runs;mkdir_recursive_atis idempotent so the now-unconditionalmake_pathfor full-bundler outputs is at worst a redundant syscall...sanitisation viaPathTemplate::print(_, true)keeps out-of-root entries under_.._/inside--outdir(covered by the last test).- The one item left open is the duplicate-
dest_pathcollision check, which the author declined as a separate change.
Extended reasoning...
Overview
Fixes bun build --no-bundle <files> --outdir=<dir>, which previously failed with ENOENT: failed to write file '""' because the transform-only path never populated OutputFile::dest_path. The change computes dest_path in Transpiler::build_with_resolve_result_eager via the same options::PathTemplate machinery the full bundler uses (honouring --entry-naming, [hash], [target], out_extensions, preserve_extensions, and ..→_.._ sanitisation), and reworks OutputFile::write_to_disk so it only relativises absolute dest_paths and always creates the parent directory when the relative path has one. Eight tests added in test/bundler/cli.test.ts.
Security risks
The one path-safety concern — an entry point outside --root producing a ../ component that escapes --outdir — is handled by PathTemplate::print(&mut v, true), which sanitises .. to _.._; the "does not escape --outdir" test asserts the file lands under dist/_.._/other/ and that other/b.js was not written outside dist/. make_path runs relative to the outdir fd via openat, so the mkdir cannot escape the output directory either. No auth/crypto/network surface touched.
Level of scrutiny
Moderate-to-high. The --no-bundle code path itself was completely broken before, so the new transpiler.rs block cannot regress existing behaviour there. But write_to_disk is shared with the full bundler (build_command.rs:1065) and bake production (production.rs:711/722/802). I traced all three: bake passes b"." as root_dir_path with relative dest_paths, so the new is_absolute guard is false and behaviour is unchanged aside from make_path now running unconditionally (idempotent mkdir -p). The full-bundler CLI path likewise sees relative dest_paths (the field is documented /// Relative), so rel_path is used verbatim as before, plus the extra make_path. CI on 6511b57 passed the eight new tests on debian aarch64, alpine x64, windows x64, and ubuntu aarch64.
Other factors
This PR has been through five prior review rounds from me; each finding (single-entry + --root mkdir gap, [hash] unfilled, data-loader extensions, Value::Copy display path, CSS size = 0) was fixed with a corresponding test. The one declined item — a duplicate-dest_path collision check mirroring generateChunksInParallel.rs:407 — is a reasonable follow-up and not a regression. There is a competing PR #31650 taking a different approach (post-processing in build_command.rs with a hardcoded .js extension); a maintainer should decide which lands. Given the non-trivial new path-computation logic and the shared-function change, deferring rather than auto-approving.
There was a problem hiding this comment.
I've reviewed this across five iterations and every finding I raised has been addressed (or reasonably scoped out — the duplicate-dest_path collision check). This pass found nothing new. Given the shared write_to_disk change also feeds bake/production.rs and build_command.rs, and there's a competing approach in #31650, a maintainer sign-off would still be worthwhile.
What was reviewed:
write_to_diskrefactor: verified both other callers (build_command.rs:1068,bake/production.rs:706/717/797) pass relativedest_paths (asserted atbuild_command.rs:1078), so gatingrelative()onis_absoluteand unconditionallymake_pathing the parent is a behaviour-preserving tightening for them...sanitisation viatemplate.print(_, true)— the out-of-root test asserts_.._/other/b.jslands underdist/andother/b.jsis not written outside it.[hash]/[target]placeholders, data-loader extension mapping, CSS.size, andValue::Copydest_path— each now covered by a test.
Extended reasoning...
Overview
Fixes #9859/#5206/#10370: bun build --no-bundle --outdir was completely broken (ENOENT on "") because the transform-only path never set OutputFile::dest_path. The fix computes dest_path in build_with_resolve_result_eager via the same PathTemplate machinery the full bundler uses, and reworks the make_path gating in OutputFile::write_to_disk so the parent directory is always created for relative outputs. ~60 LOC of Rust logic across two files, plus nine new subprocess tests in test/bundler/cli.test.ts.
Security risks
The only security-adjacent surface is path handling: an entry point outside --root produces a ../-prefixed relative path. PathTemplate::print(_, true) sanitises .. to _.._, and the eighth test asserts the output lands under dist/_.._/other/ and does not appear at ../other/b.js. platform_to_posix_in_place normalises separators so Windows \ in the template output can't bypass the dirname computation. No auth/crypto/network surface.
Level of scrutiny
Moderate. The transpiler.rs addition is confined to a code path that was 100% broken before, so regression risk there is nil. The write_to_disk change is shared with the full-bundler CLI write loop and bake/production.rs; I traced both — build_command.rs:1078 debug-asserts dest_path is never absolute, and bake passes root_dir_path = b".", so both hit the new else branch and get identical open/mkdir behaviour to before (the old relative(from_path, dest_path) on an already-relative dest_path was a no-op in practice). CI on 60c2dc4 passed on all bundler-relevant lanes including Windows and ASAN.
Other factors
This PR has been through five automated review rounds; each of the single-entry+--root, [hash], data-loader-extension, Value::Copy display-path, and CSS-size findings was addressed with a follow-up commit and a test. The one declined item (cross-file dest_path collision detection) is a reasonable scope cut — it needs the full output_files list in the CLI write loop, not per-file in the transpiler. There's a competing PR (#31650) taking a different approach (post-processing in build_command.rs with a hardcoded .js extension); this PR's approach is more complete (honours out_extensions/preserve_extensions/CSS/--entry-naming), but the choice between them is a maintainer call. Not approving on that basis plus the shared-path change, not because of any outstanding correctness concern.
|
Consolidation: #31650 is closed in favor of this PR. Merged |
alii
left a comment
There was a problem hiding this comment.
Requesting changes. The names this produces differ from bundle mode in a few places, and once --no-bundle --outdir starts writing files those names are hard to change.
- two entries that map to the same output file overwrite each other and exit 0; bundle mode errors
- [target] comes out as Browser here and browser in bundle mode
- the out_extensions / preserve_extensions block is dead, and the one thing it does (keep the source ext for a css loader) is not what bundle mode does
- the Copy arm still writes next to the source; the "./" + absolute path only feeds the summary line and keeps the assert in build_command quiet
The relative() branch left in write_to_disk is unreachable, delete it instead of narrowing it.
|
Addressed the review in c52de81 (plus 653b010 for comment length); each thread has the specifics, summary:
PR description rewritten to match. |
alii
left a comment
There was a problem hiding this comment.
Looks ready to merge from this side. Checked the five items from the last round against the new head (duplicate dest_path error, [target] spelling shared by all three sites, loader-based extension, Copy left alone, write_to_disk signature) plus the interdiff and the new tests by reading; nothing new turned up. Tests not run here. The touched files have not moved on main since the merge-base.
Previously `bun build --no-bundle <files> --outdir=dist` failed with `ENOENT: failed to write file '""'` because the transform-only path in the transpiler created OutputFile values with an empty dest_path. The CLI's write_to_disk step then tried to open an empty path relative to the outdir. Compute dest_path the same way the bundler does for entry points: relative to root_dir with the output extension from the out_extensions map, so e.g. src/main.tsx lands as dist/main.js and nested directory structure is preserved. Fixes #9859
For a single --no-bundle entry point with --root pointing above the entry's directory, longest_common_path returns the sole dest_path verbatim, so the len()-gated relativize branch is skipped and the parent directory under --outdir is never created. Move make_path outside that gate so the parent is created whenever the relative output path has a directory component.
…ive paths Route the --no-bundle output path through options::PathTemplate the same way the bundler computes entry-point paths, so --entry-naming is honoured, .. segments are sanitized to _.._ (cannot escape --outdir), and separators are normalised to / on every platform. In write_to_disk, only run resolve_path::relative when dest_path is absolute; a relative dest_path is already the path to open under the outdir fd.
Move the dest_path template computation to after the loader match so the output bytes are available to hash when --entry-naming contains [hash], matching the bundler's ContentHasher. Without this, two entries with a [hash]-only template collided on the same empty-hash filename.
For --no-bundle entry points that go through a JS-emitting loader (.toml, .yaml, .jsonc, .json5, .txt, .md) but have no entry in out_extensions, fall back to .js instead of the source extension so the output filename matches the output content and the full bundler. For file-copy loaders the output is written to the hashed pathname computed by build_copied_file_output, so set dest_path from that pathname so the CLI summary matches what is on disk.
…aths - Error on two entry points rendering to the same dest_path, with the same message bundle mode prints, instead of letting the second write truncate the first and exiting 0. - Add Target::naming_placeholder() and use it for every [target] expansion. The transform path and the asset path in bundle_v2 were using the IntoStaticStr variant name, so [target] printed "Browser" where computeChunks prints "browser". - Pick the output extension from the loader (css or js), the same way chunk content does. out_extensions maps every key to .js and preserve_extensions is never set, so the lookup was dead, and it kept the source extension for a css loader on a non-.css file. - Leave dest_path empty for file-copy loaders: copy_to writes to FileOperation.pathname and ignores dest_path, so setting it only changed the summary line. - write_to_disk: dest_path is always relative here, so drop the root_dir_path parameter and the relative() branch that used it.
653b010 to
62647e6
Compare
p.rs: the import list loses FunctionKind (removed on main) and LOC_MODULE_SCOPE (removed on this branch). jsc_hooks.rs: #39327 deleted the resolve hook this branch had converted, so it is gone. Three sites main added against the old Loc follow the branch: bun pm diff (#39229) sorts scope members by Option<Loc>, with a member that has no location first as the -1 sentinel used to sort, and its synthesized block has no close brace location; the duplicate output path error in transpiler.rs (#35644) carries no location.
Fixes #9859
Fixes #5206
Fixes #10370
Problem
bun build --no-bundle <entries> --outdir=<dir>printsENOENT: failed to write file '""'for every entry and writes nothing. Single and multiple entry points both fail; only--outfileand stdout work.Transpiler::build_with_resolve_result_eager(src/bundler/transpiler.rs) builds eachOutputFilefromzero_value()and never setsdest_path, so the write loop in src/runtime/cli/build_command.rs opens""under the outdir fd.[target]asBrowser/(src/bundler/bundle_v2.rs used the enum variant name) while entry points wrotebrowser/. This is a regression from the Rust port: the old Zig site used@tagName(bundle_v2.zig:1806), so assets came out asbrowser/andbun/. It also affects the default[dir]/[target]/[name]-[hash].[ext]asset template that fullstack builds with server HTML imports get without any--asset-namingflag, not just an explicit--asset-naming '[target]/...'.Fix
dest_pathfor every transpiled (Value::Buffer) output through the samePathTemplateentry points use incomputeChunks:[dir]/[name]from the path relative to--root,[ext]from the loader (cssfor the css loader,jsotherwise, likeContent::ext()),[hash]from the output bytes,[target]from the newTarget::naming_placeholder(),..sanitised to_.._, posix separators. So--no-bundle --outdirproduces the same file names asbun build --outdirfor the same flags, which matters because these names become a compatibility surface once they are written.transform()rejects two inputs landing on onedest_pathwith the sameMultiple files share the same output patherror (and entry-naming note) bundle mode emits, instead of the second write truncating the first and exiting 0.Target::naming_placeholder()(src/ast/target.rs) replaces the inline match incomputeChunksand theIntoStaticStruse inbundle_v2.rs, so[target]spells the same in entry, asset, and--no-bundleoutput. For assets this restores the pre-portbrowser/bunspelling;macroandssrchange from the oldbun_macro/bake_server_components_ssrtomacro/ssr, matching whatcomputeChunksalready emits for entry points.OutputFile::write_to_disknow takes only the dir fd:dest_pathis always outdir-relative at its callers (build_command asserts this right after the call; bake passes template output), so therelative()branch and itsroot_dir_pathparameter are gone and the Buffer arm is mkdir parent, write. The parent is created unconditionally, which also covers a single entry with--rootabove it (previouslylongest_common_pathof one path echoed it back and the length gate skipped the mkdir)..wasm,.node, ...) are unchanged:copy_towrites toFileOperation.pathnameand ignoresdest_path, so they keep an emptydest_pathas on main. Their output still lands next to the source; that is a separate pre-existing bug and is filed separately.sizeset so the summary does not print0 B.test/bundler/cli.test.ts(--no-bundle with --outdirblock, 14 tests: single, multiple, nested, single +--root, shared subdir +--root, collision error,[target]x3 viareaddir,--entry-naming,[hash], loader-based extensions incl.--loader .pcss:css, outside-root, in-place--outdir .) all fail on the released build and pass with this change;test/bundler/bundler_naming.test.tsgainsnaming/EntryNamingTargetandnaming/AssetNamingTarget(the asset one fails on main);test/bake/dev/production.test.tspasses with thewrite_to_disksignature change;bundler_string.test.tsand theNoBundleesbuild tests still pass.Background
--no-bundlemakesbun buildtranspile each entry point independently (Transpiler::transform->process_resolve_queue->build_with_resolve_result_eager) instead of going throughBundleV2; the bundler's linker, which normally computes output paths and writes files, is never involved, so this path has to producedest_pathitself.PathTemplateis the[dir]/[name].[ext]-style template behind--entry-naming/--chunk-naming/--asset-naming.print(.., sanitize_parent_dirs)fills the placeholders and rewrites..segments so an input outside--rootcannot write outside--outdir.OutputFile.dest_pathis the outdir-relative path the CLI prints in the summary and passes toopenaton the outdir fd;OutputFile.valueis either the bytes to write (Buffer), a file to copy (Copy), or already written by the linker (Saved).--root(outbase) is the directory output paths are computed relative to; it defaults to the common ancestor of the entry points.no test proof · iteration 0 · Platform-specific test(s) that do not run on this machine. Deferring to CI, which covers all platforms: test/bundler/cli.test.ts