diegohaz / arc

React starter kit based on Atomic Design
https://arc.js.org
2.91k stars 295 forks source link

Is full lodash required? #313

Closed mininternet closed 7 years ago

mininternet commented 7 years ago

In an effort to keep the production bundle small, would it be possible to only install the required lodash functions, rather than the entire package?

In components would be import filter from 'lodash.filter'

diegohaz commented 7 years ago

We use import filter from 'lodash/filter' so, even though we have the entire lodash package installed, we only bundle those functions we actually use.

mininternet commented 7 years ago

Ah, I see. I'm not a webpack expert, just saw the entire library in package.json, but verified with visualizer that only those functions are being bundled.

code_packages

I've been installing the individual lodash functions i've needed, but i guess can just import them from the already installed package, good to know.

Thanks!