-
-
Notifications
You must be signed in to change notification settings - Fork 180
Support Configurable Settings File #212
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
Conversation
|
This is long overdue. Thank you for taking the time to try and address it. |
.bundlesizeconfig
Outdated
@@ -0,0 +1,8 @@ | |||
{ | |||
"bundlesize": [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you need to nest the options in a bundlesize property? I thought it would be assumed that all options in this file would relate to the bundlesize library.
eg. this .jestconfig file is not nested: https://github.com/yangshun/commitbait/blob/master/.jestconfig
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just spotted it's an array. May be tricky then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea I questioned that as well. Thought you could maybe build on this in the future and maybe do things like define your compression in here. Or add other setting values above that, while keeping the bundlesize an array of objects for your checks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As @ssulivan11 mentioned. Naming this files
would be good to allow other configuration options in the future here too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@siddharthkp what is your opinion on this one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree with all of the comments
bundlesize
key is redundant, you can replace it with files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! Have updated the tests and docs for this.
@siddharthkp any thoughts on this? Would love to have this functionality in bundlesize. |
Sorry, I was on a laptopless vacation 😄 This is a great feature, I'll get around to testing it soon, I promise |
@debugme , the code was updated. Can you please take a look again? Would love to have this functionality in bundlesize. 🙏 |
Hello @siddharthkp, any update on publishing this into your package? |
Was just looking into building this myself, any updates? 👀 |
In my fork have added the ability to export module instead of only having JSON file support. This is to fit inline with all the other packages at the moment moving towards this, eg: babel7, eslint... Could add that too if anyone is interested. |
Implemented in #316 and published in 0.18.0 🎉 Check out README for details |
Description
When --config is passed in cli and there is a valid bundlesize.json file present in the project, then the bundlesize settings will be pulled from this file, and not from package.json
Motivation and Context
In a project with a lot of code chunks that are all validated with this bundlesize checker tool, it bloats the package.json. Wanted an external config to bring all that into a common area. Didnt expand too much into things like yaml file or anything overly complex, just a good place to start for the people who need smaller package.json files 😄
Types of changes
Checklist:
- Updated first step in README
- Allow bundlesize to be configured by a file rather than relying on package.json #206
- Add a way to move bundlesize configuration #162
- Feature Request: allow additional settings from package.json config #173