Trim down install size by 5 mb by dropping lodash #13134
Labels
i: enhancement
i: needs triage
outdated
A closed issue/PR that is archived due to age. Recommended to make a new issue
Feature Request
Is your feature request related to a problem?
Currently every babel installation installs
lodash
as a dependency, because it is required by@babel/types
. This consumes 5MB of disk space for every babel installation.Doing a quick grep over babel's repo the
lodash
package is used for the following tasks:babel/packages/babel-plugin-transform-function-name/test/fixtures/function-name/modules-2/input.mjs
Line 9 in 9808d25
Object
constructorbabel/packages/babel-types/src/converters/valueToNode.ts
Line 98 in 6b39baf
babel/eslint/babel-eslint-plugin/test/rules/no-invalid-this.js
Line 55 in 7bc72bb
babel/packages/babel-register/src/node.js
Line 45 in 6b39baf
babel/packages/babel-cli/src/babel/dir.js
Line 138 in 98aa72c
A small footprint is desireable as it makes docker images smaller which in turn lead to faster deployments.
Describe the solution you'd like
Smaller install size. I did start a small ~4kb lodash clone a while back, but it's missing
isPlainObject
. The rest should work out of the box. Functions like getting the last element of an array should probably be just inlined though.Describe alternatives you've considered.
Documentation, Adoption, Migration Strategy
The text was updated successfully, but these errors were encountered: