Lodash gatsby plugin and bundle sizes #29990
Unanswered
juanbiberretta
asked this question in
Help
Replies: 1 comment 1 reply
-
That's odd, any reason why you're stuck on version 2.26.0? Do you by any chance have a require('lodash') somewhere? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone!
I've been playing around with decreasing the size of our project and came across the
gatsby-plugin-lodash
that utilizes both the webpack and babel plugins to cherry-pick and trim the module. I had the webpack bundle analyzer show me what it looks like and this is what I get:Close up

I was under the impression that using the plugins would mean I only kept around a trimmed version of library, which is what I believe I see in the
commons-
bundle, but I'm not sure what the other, full, version of the package is doing hanging out in the hashed bundle. How can I tell if the full version is getting used? I'm aware that thecommons-{hash}
bundle is sent to all my pages...Maybe all's good and this is how it's supposed to be, but I've been wondering about this for a while. I just hope I'm doing it right.
My package versions:
gatsby-config.js
I'm not sure if this matters much but I'll put it here for good measure, we have a custom
.babelrc.
:We have a mixture of files importing things like
import get from lodash/get
andimport { get } from 'lodash'
but that shouldn't matter since the whole point of the Babel plugin is that it transpiles this to use modular imports.Would love any insights, thank you!
Beta Was this translation helpful? Give feedback.
All reactions