Feature Request: allow additional settings from package.json config
See original GitHub issueDo you want to request a feature or report a bug?
feature request
What is the current behavior?
The library loads settings like this:
- One
path
and onemaxSize
from CLI options, OR - An array of
path
/maxSize
settings from package.json at keybundlesize
- An API token via
ci-env
andprocess.env
settings - (other sources in elsewhere in code?)
If this is a feature request, what is motivation or use case for changing the behavior?
Two-part request:
- permit more settings to come from package.json
- collate all the config setting sources together in
src/config.js
, and use those where needed in code.
I have a specific setting I’d like to request, but in deference to the contribution guide, here’s our discussion issue first. 😃
Also my feature is semi-trivial, but the existing code doesn’t easily allow extra settings. So to fix that, I have already done a proof of concept over here. It includes all the changes I guessed were necessary to allow more configuration. I also added unit tests via jest in addition to self-exercise test script that was inline in the current package.json file.
I picked jest rather than a more minimal testing framework for its ease of mocking require
statements. Because the library uses both package.json parsing and commander argv parsing, I thought it was worthwhile.
Please mention other relevant information.
- node version 8.4
- npm version 5.4
- Operating system Linux/ WSL-windows
- bundlesize version 0.15.3
- CI you are using: Circle
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
Implemented in https://github.com/siddharthkp/bundlesize/pull/316 and published in 0.18.0 🎉
Check out README for details
Sorry for my confusion here, but I don’t know what you are intending. Should I submit a PR, or wait for those other tickets, or what?