Skip to content

Add option report-json #322

@tyankatsu0105

Description

@tyankatsu0105

Do you want to request a feature or report a bug?
feature

What is the current behavior?
Report function does not exist.

If the current behavior is a bug, please provide the steps to reproduce.

What is the expected behavior?
When run npm run bundlesize --output-json,
output bundlesize-report.json.

[
  {
    "message": "./dist/js/about.93459521.js: 282B < maxSize 10KB (gzip)",
    "fail": false,
    "size": 282,
    "maxSize": 10240
  },
  {
    "message": "./dist/js/app.0b7c728b.js: 2.21KB < maxSize 10KB (gzip)",
    "fail": false,
    "size": 2264,
    "maxSize": 10240
  },
  {
    "message": "./dist/js/chunk-vendors.f167eeb4.js: 40.63KB > maxSize 10KB (gzip)",
    "fail": true,
    "size": 41608,
    "maxSize": 10240
  },
  {
    "message": "./dist/css/app.c6167d4a.css: 271B (gzip)",
    "fail": false,
    "size": 271,
    "maxSize": null
  },
  {
    "message": "./dist/img/logo.82b9c7a5.png: 11.44KB (no compression)",
    "fail": false,
    "size": 11713,
    "maxSize": null
  }
]

This option is always exit code 0.
So --report-json option is not always an error.

If this is a feature request, what is motivation or use case for changing the behavior?
We can edit data made from bundlesize

Please mention other relevant information.

  • node version 11.8.0
  • npm version 6.5.0
  • Operating system nodenv
  • bundlesize version 0.18.0
  • CI you are using TravisCI

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions