If the function isn't used in the code in any way, it will get stripped from the production output due to a process called tree shaking. It's an optimization that looks at code imports and then eliminates any unused code as a result.

It turns out that was the case here as each wasn't used and it was imported only.

Answer from Juho Vepsäläinen on Stack Overflow
🌐
npm
npmjs.com › package › lodash-es
lodash-es - npm
2 weeks ago - The Lodash library exported as ES modules.
      » npm install lodash-es
    
Published   Apr 01, 2026
Version   4.18.1
🌐
GitHub
github.com › lodash › lodash › issues › 4800
How to use lodash-es using import in Node 14? · Issue #4800 · lodash/lodash
June 3, 2020 - CommonJS modules can be imported by importing the default export. This is because node.js treats the files in lodash-es as CommonJS instead of ES6 modules.
Author   josdejong
Discussions

Correct way to import lodash
I converted all of my lodash imports to import { ... } from 'lodash-es'; My bundle still includes the whole library. 2019-01-28T00:55:26.97Z+00:00 ... @IsaacPak Make sure that you are not transpiing ES modules to CommonJS. If you are using TypeScript, you have to set --module compiler option ... More on stackoverflow.com
🌐 stackoverflow.com
Merge lodash-es into lodash package
This doesn’t work with modules (.mjs files) in NodeJS. Instead, lodash needs to be imported as a default import. I believe both issues would be resolved if the lodash-es package is merged into the lodash package, but with every file using an .mjs extension instead of a .js extension. More on github.com
🌐 github.com
61
March 3, 2021
ts node - How to use lodash-es in typescript correctly? - Stack Overflow
It doesn't touch .js files; either ... hook (essentially the same thing that is used by babel-node). You would still need to configure @babel/register not to ignore node_modules, as described in the other answer. The advice from the other answer to just use lodash instead of ... More on stackoverflow.com
🌐 stackoverflow.com
lodash-es modules should be published to NPM with ".mjs" extension
Using lodash-es 4.17.4, if I try to run the following file in Node 8.5.0: test.mjs: import {map} from 'lodash-es'; node --experimental-modules test Then the following error occurs: SyntaxEr... More on github.com
🌐 github.com
6
October 2, 2017
🌐
Blazemeter
blazemeter.com › blog › import-lodash-libraries
Your Lodash Tutorial: How To Import Lodash Libraries | Perforce BlazeMeter
If you want to minimize your Lodash bundle size, try to import only your used functions, with each function by its own module.Back to top · Another option you can use is lodash-es: the Lodash library exported as ES modules.
🌐
DEV Community
dev.to › oooopsitsme › why-you-should-use-lodash-es-in-your-typescript-projects-153n
Why You Should Use `lodash-es` in Your TypeScript Projects - DEV Community
August 23, 2024 - lodash-es is the ECMAScript module (ESM) version of Lodash. It's designed to be tree-shakeable, meaning you only include the parts of the library you actually use in your bundle.
🌐
Medium
medium.com › @iamalexcarter › whats-the-difference-between-lodash-and-lodash-es-f3e3be29ec9e
What’s the Difference Between Lodash and Lodash-ES | by Alex Carter | Medium
November 4, 2024 - Bundle size optimization is crucial for application performance. While Lodash has long been a go-to utility library, its ES module counterpart, Lodash-ES, offers significant advantages in terms of bundle optimization.
🌐
GitHub
github.com › lodash › lodash › tree › es
GitHub - lodash/lodash at es
March 3, 2021 - The Lodash library exported as ES modules.
Starred by 61.6K users
Forked by 7.1K users
Languages   JavaScript 97.2% | HTML 2.3% | EJS 0.5% | JavaScript 97.2% | HTML 2.3% | EJS 0.5%
Find elsewhere
🌐
GitHub
github.com › lodash › lodash › issues › 5107
Merge lodash-es into lodash package · Issue #5107 · lodash/lodash
March 3, 2021 - This doesn’t work with modules (.mjs files) in NodeJS. Instead, lodash needs to be imported as a default import. I believe both issues would be resolved if the lodash-es package is merged into the lodash package, but with every file using an .mjs extension instead of a .js extension.
Author   remcohaszing
🌐
GitHub
github.com › lodash › lodash › issues › 3407
lodash-es modules should be published to NPM with ".mjs" extension · Issue #3407 · lodash/lodash
October 2, 2017 - Using lodash-es 4.17.4, if I try to run the following file in Node 8.5.0: test.mjs: import {map} from 'lodash-es'; node --experimental-modules test Then the following error occurs: SyntaxError: The requested module does not provide an ex...
Author   jacksonrayhamilton
🌐
Lodash
lodash.com
Lodash
Lodash is available in a variety of builds & module formats. lodash & per method packages · lodash-es, babel-plugin-lodash, & lodash-webpack-plugin · lodash/fp · lodash-amd · futil-js is a set of functional utilities designed to complement lodash · Contributing ·
🌐
Today I Learned
til.hashrocket.com › posts › dnzttruljf-prefer-lodash-es-when-using-webpack
Prefer lodash-es when using webpack - Today I Learned
November 14, 2023 - The lodash package needs to be able to support all browsers, it uses es5 modules. The lodash-es package uses es6 modules, allowing for it to be tree shaked by default in webpack v4.
🌐
GitHub
github.com › lodash › lodash › issues › 4366
lodash ES6 and UMD modules should be provided in a single package · Issue #4366 · lodash/lodash
July 15, 2019 - the 'lodash-es' NPM package only provides the ES6 module format (and can not be used in an ES5 setup)
Author   wb459
🌐
CodingNomads
codingnomads.com › intro-javascript-es-modules
Introduction to JavaScript ES Modules
In the next main section of this ... But first, you'll look at how to use modules with libraries that do support them. For example, if you look at Lodash, you'll see that they have a page of custom builds, one of which is the lodash-es version....
🌐
DEV Community
dev.to › pffigueiredo › making-lodash-tree-shakable-3h27
Making lodash tree-shakable - DEV Community
November 23, 2023 - In today's web development, ECMAScript is the go-to standard for writing JS modules and it's being widely adapted not only on the browser but also on node environments. This standard is much more mature and offers much better support for static analysis and tree shaking due to its more declarative and static nature. Now that we have gone through why tree shaking doesn't play well with lodash, let's dive into what we can do we make it tree-shakable. ... Due to the huge amount of benefits of using ESM (ECMAScript Modules), the lodash-es lib was created and it's now the recommended package to be installed if you want to continue to use lodash, it is still the same library, but exported as ES modules.
🌐
npm
npmjs.com › package › @types › lodash-es
@types/lodash-es - npm
November 21, 2023 - TypeScript definitions for lodash-es. Latest version: 4.17.12, last published: 2 years ago. Start using @types/lodash-es in your project by running `npm i @types/lodash-es`. There are 1528 other projects in the npm registry using @types/lodash-es.
      » npm install @types/lodash-es
    
Published   Nov 21, 2023
Version   4.17.12
🌐
BrowserStack
browserstack.com › home › guide › how to import lodash: tutorial
How to Import Lodash: Tutorial | BrowserStack
October 31, 2025 - Module-Specific Import: The smallest bundle size, with only the necessary Lodash modules included, reducing the size significantly. You can optimize how Lodash is imported in a React project to reduce bundle size and improve performance. Here are three common methods: using lodash-es, the Lodash ...
🌐
Yarn
yarnpkg.com › package
lodash-es
February 6, 2022 - Yarn is a package manager that doubles down as project manager. Whether you work on simple projects or industry monorepos, whether you're an open source developer or an enterprise user, Yarn has your back · First package manager built specifically around workspaces, Yarn lets you split your ...
🌐
GitHub
github.com › webpack › webpack › issues › 1750
tree-shaking with lodash-es · Issue #1750 · webpack/webpack
December 12, 2015 - See #1612 (comment). Currently tree-shaking lodash-es modules is not possible with webpack 2 beta. First clone into node_modules: git clone -b es --depth=1 https://github.com/lodash/lodash.git ./node_modules/lodash-es then: npm i -g webp...
Author   jdalton