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

Add a "minimum" size in addition to "limit" #12

Open
boris-petrov opened this issue Jul 2, 2019 · 3 comments
Open

Add a "minimum" size in addition to "limit" #12

boris-petrov opened this issue Jul 2, 2019 · 3 comments

Comments

@boris-petrov
Copy link
Contributor

The reasoning is this - sometimes I could delete a bunch of code or maybe some dependency and my bundle would become much smaller. The bundle-size test would pass easily. Then, later on, I do some stupid mistake which increases my bundle size a lot but I still won't catch it by the bundle-size test because the size is still lower than the initial "limit" that I set.

If we have a "minimum" option then I would lower both it and the "limit" after I remove the dependency initially and then the second time I would catch the mistake I do.

Not sure if I make sense but this is something that I think is possible and would be nice to have.

@simonihmig
Copy link
Member

I think relative size checks would be a better solution, see #10. Do you agree?

@boris-petrov
Copy link
Contributor Author

@simonihmig - I read that issue, yes, however there are 2 advantages of what I suggest in this issue:

  1. It should be trivial to implement - just a few lines of code more I guess.

  2. The problems that you mention in the other issue are non-trivial to figure out. So I guess until then the "minimum" size I suggest is a simple workaround.

Otherwise yes, maybe the relative checks are better.

@jelhan
Copy link

jelhan commented Oct 13, 2019

I fear that managing both minimum and limit is hard to maintain and error prune. Maybe we should only set an expected asset size, which the actual asset size must not differ too much from? What is considered too much should be configurable and may default to 1% or something alike. It may provide another option, which controls if the build should fail on too low sizes. Would be the same as here but a more intuitive logic in my opinion.

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

No branches or pull requests

3 participants