bundlesize icon indicating copy to clipboard operation
bundlesize copied to clipboard

Add minSize option

Open larionov opened this issue 6 years ago • 6 comments

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

What is the current behavior? bundlesize only checks for maxSize

What is the expected behavior? To be able to check minSize too.

If this is a feature request, what is motivation or use case for changing the behavior? Would be nice to check for build errors that result in empty or drastically different bundle sizes.

larionov avatar Apr 02 '18 10:04 larionov

🤔

I don't think this is something bundlesize should do. It can't replace the need for functional tests

siddharthkp avatar Apr 02 '18 11:04 siddharthkp

@siddharthkp I agree that functional tests are needed but just now I had a problem when empty css files was generated in our package. That requires automated visual tests and that is not fast. Also, bundlesize and maxSize names kind of imply that this package checks everything about sizes. I even tried to add minSize option in our config without checking docs first.

larionov avatar Apr 02 '18 12:04 larionov

bundlesize and maxSize names kind of imply that this package checks everything about sizes

I didn't try to imply that 😅

I had a problem when empty css files was generated in our package. That requires automated visual tests and that is not fast.

What would you set as the minSize for such case? > 0 bytes?

siddharthkp avatar Apr 02 '18 12:04 siddharthkp

On Mon, Apr 2, 2018, 19:49 Siddharth Kshetrapal [email protected] wrote:

bundlesize and maxSize names kind of imply that this package checks everything about sizes

I didn't try to imply that 😅

I can see that 😂

I had a problem when empty css files was generated in our package. That requires automated visual tests and that is not fast.

What would you set as the minSize for such case? > 0?

I would set it slightly less then the current size. And I would say that if the size gets lower intentionally you have to change maxSize to match that too, to still be able to control it.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/siddharthkp/bundlesize/issues/207#issuecomment-377922483, or mute the thread https://github.com/notifications/unsubscribe-auth/AAKoquQMeZjEl0cUiWc51Z53eTNW8kDaks5tkh5dgaJpZM4TDap4 .

larionov avatar Apr 02 '18 12:04 larionov

Would also like this feature. My project outputs a UMD library bundle with other third-party libraries included inside. It would be great for us to be alerted when our bundle size increases or decreases significantly due to a library's size changing.

ghost avatar Aug 10 '18 16:08 ghost

Here's another use case: If you're using webpack with aggressive bundle merging, it's nice to be alerted when a bundle size goes down so that you can reconfigure the maxSize.

delambo avatar Feb 14 '19 19:02 delambo