Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cli): user-friendly console output of chunk information #727

Merged
merged 3 commits into from
Apr 3, 2024

Conversation

kazupon
Copy link
Sponsor Contributor

@kazupon kazupon commented Apr 2, 2024

Description

The rolldown CLI only outputs the following exit message and time when a build is executed with the command.

This PR user-friendly output to console like vite.

  • before
rolldown-cli-friendly-1
  • after
rolldown-cli-friendly-2

Test Plan


Copy link

netlify bot commented Apr 2, 2024

Deploy Preview for rolldown-rs canceled.

Name Link
🔨 Latest commit 400ca6c
🔍 Latest deploy log https://app.netlify.com/sites/rolldown-rs/deploys/660d4ac6baf96f00084c440c

@@ -14,13 +19,133 @@ export async function bundle(configExport: RolldownConfigExport) {
}

async function bundleInner(options: RolldownOptions) {
const start = performance.now()
const dir = options.output?.dir ?? 'dist'
Copy link
Sponsor Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default for dir is held by the Rust side.

dir: raw_output.dir.unwrap_or_else(|| "dist".to_string()),

I think we need a mechanism to share dir defaults between JS side and Rust side.
If we change this value on either side, it may not work.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For non-gziped size, you should able to get them in the returned value of write or generate. However, this might still slow down the performance potentially if we didn't do the optimization in #696.

I suggest we now only print non-gized sizes. It should solves

  • the performance problem of large project
  • not knowing default for dir problem

@hyf0 hyf0 self-assigned this Apr 2, 2024
@kazupon
Copy link
Sponsor Contributor Author

kazupon commented Apr 3, 2024

I have dropped the display gzip size feature.

Copy link
Member

@hyf0 hyf0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@hyf0 hyf0 force-pushed the fix/friendly-output-info branch from 6d2ae85 to 400ca6c Compare April 3, 2024 12:25
@hyf0 hyf0 enabled auto-merge (squash) April 3, 2024 12:25
@hyf0 hyf0 merged commit 4b461cf into rolldown:main Apr 3, 2024
15 checks passed
@kazupon kazupon deleted the fix/friendly-output-info branch April 3, 2024 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants