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

Allow bundlesize to be configured by a file rather than relying on package.json #206

Closed
debugme opened this issue Mar 25, 2018 · 3 comments

Comments

@debugme
Copy link

debugme commented Mar 25, 2018

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

What is the current behavior?
Configuration can only be read from package.json file

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

What is the expected behavior?
To be able to pass in configuration by specifying path to a file.

For example:

$ bundlesize --config ./configs/bundlesize/config.json

If this is a feature request, what is motivation or use case for changing the behavior?

Avoid cluttering up package.json

Please mention other relevant information.

  • node version
  • npm version
  • Operating system
  • bundlesize version
  • CI you are using
@tdeekens
Copy link

I would love this feature too. This should be fairly easy to achieve with this package https://github.com/davidtheclark/cosmiconfig. It is for instance used in jest-runner-eslint among others. Would you be interested in a PR for this?

@Johann-S
Copy link

Related to: #162

wmfgerrit pushed a commit to wikimedia/mediawiki-extensions-MobileFrontend that referenced this issue Aug 30, 2018
This patch adds a production build output gzipped file size check to the
test script so that any future changes may only introduce known size
differences. Note:

 • The initial limit was taken from the present gzipped file size rounded
   up to the 10th of a kibibyte.

 • JEDEC notation is used. bundlesize internally uses Bytes utility which
   only supports base 2 units.

   https://github.com/visionmedia/bytes.js

 • The bundlesize config cannot yet be stored in a distinct file.

   siddharthkp/bundlesize#206

Bug: T202742
Bug: T199452
Change-Id: Ic7766f16918db47371e081bf6542e133544d7d0d
@siddharthkp siddharthkp added this to the Easier to configure milestone Jun 27, 2019
@siddharthkp
Copy link
Owner

Implemented in #316 and published in 0.18.0 🎉

Check out README for details

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants