When consuming this library as a module, the entire lodash library is included.
Actual Behavior
The entire library is included because the module build does not get the advantages provided by the webpack/babel plugins in the non-module version.
I don't think you should expect end-users to subsequently use webpack/babel on their downstream package because they might not be using these libraries, and/or they're never going to notice that this dependency is being included.
Possible Solution
You could:
Switch to lodash-es and remove all of the code related to the babel/webpack plugins.
Expected Behavior
When consuming this library as a
module
, the entirelodash
library is included.Actual Behavior
The entire library is included because the module build does not get the advantages provided by the webpack/babel plugins in the non-module version.
I don't think you should expect end-users to subsequently use webpack/babel on their downstream package because they might not be using these libraries, and/or they're never going to notice that this dependency is being included.
Possible Solution
You could:
Steps to Reproduce
contentful
lodash
is includedContext
Added ~ 24KB lodash library to payload
Environment
Application: