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

Feature request: Output some build results #631

Closed
exalted opened this issue Dec 30, 2020 · 8 comments
Closed

Feature request: Output some build results #631

exalted opened this issue Dec 30, 2020 · 8 comments

Comments

@exalted
Copy link

exalted commented Dec 30, 2020

On a successful run esbuild CLI will currently output nothing and exit with 0 status code.

This is GREAT actually, however I'd appreciate some output either via --log-level=info or a new flag (e.g., --verbose).

For the most part I am looking for some output which indicates which files have been bundled (source & destination), how much it took to process each file and overall time spent, etc.

Thanks.

@evanw evanw closed this as completed in f702341 Dec 31, 2020
@evanw
Copy link
Owner

evanw commented Dec 31, 2020

Thanks for asking for this. This has been a request in the past from others as well and is something I have also wanted on occasion. I just added a new flag for this: --summary. You can see an example of what it looks like in the release notes. This feature will go out with the next release.

I chose --summary instead of --verbose because I'd like to reserve --verbose for verbose debugging output if it's necessary in the future. And I didn't include the time to process each file in the summary because that's not something I can measure. Files are processed in parallel instead of sequentially and many intermediate steps are shared between output files.

@exalted
Copy link
Author

exalted commented Dec 31, 2020

Looks neat @evanw . Thank you! 🙂

@exalted
Copy link
Author

exalted commented Dec 31, 2020

I personally don't use --serve, however I wonder if this kind of output would be useful in that as well (i.e., if f702341 doesn't already cover that as well). :two-cents:

@saramorillon
Copy link

Hello, is this feature available? I get this error when I try to use it:
image

@evanw
Copy link
Owner

evanw commented Nov 4, 2022

This option was removed. Instead, esbuild now just always prints a summary by default. This has been the case for over a year now. This change happened in esbuild version 0.9.0, released in March 2021.

@saramorillon
Copy link

saramorillon commented Nov 4, 2022

Hello @evanw , thank you for your answer. I don't see a summary when I use esbuild v0.15.13. Here is my build script:

require('esbuild').build({
  entryPoints: ['src/index.ts'],
  bundle: true,
  outdir: 'dist',
  minify: true,
  sourcemap: true,
  watch: true,
})

Am I doing something wrong?
(Please note that I'm new to esbuild)

@evanw
Copy link
Owner

evanw commented Nov 4, 2022

You are missing logLevel: "info". The log level only defaults to info for the CLI. It defaults to warning when using the JS build API, so you'll need to set it to info if you want to see info log messages.

@saramorillon
Copy link

Thanks a lot, it's working now!

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 a pull request may close this issue.

3 participants