Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

205
Vistas
Lodash: tree shaking

When I try to use lodash function as a specific import as shown below then it shows to be it loads only 14.7KB in size. enter image description here

But when I try to use the import as a destructured object then it shows 69.6KB in size enter image description here

Some articles say it works the same for both the above imports while some say it doesn't. Just wanted to understand does it add the complete build or only a specific function in the final build, especially the 2nd syntax (destructuring)

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

$ npm i -D babel-plugin-lodash

.babelrc
{
  ...,
  "plugins": [..., "lodash"]
}

This will allow for any import style (e.g. import _ from 'lodash', import { isEqual } from 'lodash' as the plugin will transform each usage of a lodash func to: import xyz from 'lodash/xyz';

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda