Decisiv / styled-components-modifiers

A library to enable BEM flavored modifiers (and responsive modifiers) in styled components.
MIT License
297 stars 11 forks source link

Expect to reduce the production bundle size when this package is included #58

Open samarpanda opened 3 years ago

samarpanda commented 3 years ago

EXPECTED BEHAVIOR

Pretty nice lib thanks for publishing. Recently included this in one of my project to create typography theme. But noticed that this increased my production bundle size. Digging dipper found that lodash is one of the core dependency here. That might be causing this issue.

_What's the behavior you're expecting to see?

Expecting to add specific methods of lodash instead of including the complete package. So, the production bundle size can be reduced a lot.

ACTUAL BEHAVIOR

Scope of further reducing the production bundle size.

STEPS TO REPRODUCE

Include this in any of the project. Compare prior and after including styled-components-modifiers. You can easy find the bundle will be increased substantially.

SUGGESTED SOLUTION

Wondering if we need the complete lodash package. Haven't gone through the source code. But feels like we can use specific methods of lodash as needed. So, it can substantially reduce the build size.

samarpanda commented 3 years ago

Wondering if that needs to be fixed on the build process. Anything you recommend while using this package?