feat(bundler): show bundle sizes in the finished output#15644
feat(bundler): show bundle sizes in the finished output#15644tenderdeve wants to merge 1 commit into
Conversation
Append a human-readable size to each bundle path in the "Finished N bundles at:" log, so the sizes are visible right after `tauri build` instead of having to look them up manually. Directory bundles (e.g. macOS `.app`) are measured recursively. Closes tauri-apps#15341
Package Changes Through 52b85f7There are 12 changes which include tauri-bundler with minor, tauri with minor, tauri-build with minor, tauri-utils with minor, tauri-runtime-wry with minor, tauri-runtime with minor, tauri-codegen with minor, tauri-macros with minor, tauri-plugin with minor, tauri-cli with minor, tauri-macos-sign with minor, tauri-driver with minor Planned Package VersionsThe following package releases are the planned based on the context of changes in this pull request.
Add another change file through the GitHub UI by following this link. Read about change files or the docs at github.com/jbolda/covector |
| } | ||
|
|
||
| /// Formats a byte count into a human-readable string, e.g. `12.3 MB`. | ||
| fn human_readable_size(bytes: u64) -> String { |
There was a problem hiding this comment.
let's use something like https://crates.io/crates/human_bytes instead, since we might share it in tauri-cli for the future uses
| /// Total size in bytes of a bundle path, recursing into directories (e.g. macOS `.app`). | ||
| /// | ||
| /// Returns `None` if the path can't be read. | ||
| fn bundle_size(path: &std::path::Path) -> Option<u64> { |
There was a problem hiding this comment.
Could you give this a quick test see how much time it usually takes to run?
| @@ -0,0 +1,5 @@ | |||
| --- | |||
| "tauri-bundler": "minor:feat" | |||
There was a problem hiding this comment.
let's also include tauri-cli so the changelog appears there as well
Closes #15341
After
tauri build, the sizes of the generated bundles aren't shown — you have to look them up manually. This appends a human-readable size to each path in theFinished N bundles at:output:Directory bundles (macOS
.app, etc.) are measured recursively; size lookup is best-effort and falls back to no size annotation if a path can't be read, so it never fails the build.Added a unit test for the size formatting.