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

feat: Add option --report-json #323

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tyankatsu0105
Copy link

Description

When runnpm run bundlesize --report-json, output file bundlesize-report.json in working directory.

Motivation and Context

We can edit data made from bundlesize

Screenshots (if appropriate):

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist:

  • My code follows the code style of this project.
  • If my change requires a change to the documentation I have updated the documentation accordingly.
    • I’m thinking about whether to add this option for README.md.
  • I have read the CONTRIBUTING document.
  • I created an issue for the Pull Request
    Closes Add option report-json #322

@SilentImp
Copy link

Any updates?
I need this feature :)

@followdarko
Copy link

i am also need it

@tyankatsu0105
Copy link
Author

@siddharthkp
Would you mind reviewing this PR?


const reportJson = results => {
if(report){
fs.writeFileSync('bundlesize-report.json', JSON.stringify(results,null,2))

Choose a reason for hiding this comment

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

Is it possible to customize the report filename?

Copy link
Author

Choose a reason for hiding this comment

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

Of course!
It's possible, if I add args--report-json-name.

@shwarcu
Copy link

shwarcu commented Oct 28, 2021

@kevindantas @siddharthkp is there any chance having this topic moved forward?

@siddharthkp
Copy link
Owner

The chances are higher if this is ported over to https://github.com/siddharthkp/bundlesize2

@Liubasara
Copy link

Any news? I think this feature is great

@siddharthkp
Copy link
Owner

Any news? I think this feature is great

Nope, I don't think I'll merge this to this repository, happy to accept a PR for https://github.com/siddharthkp/bundlesize2 though

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.

Add option report-json
7 participants