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

281
Vistas
How to get a lodash custom (reduced) build suitable for es modules import?

I mean for example:

lodash include=each,find,filter,map,some,debounce,defer,delay,throttle,uniq,assign,extend,merge,omit,without,findIndex,compact,replace,groupBy,max,uniqueId

When I try to import in es modules, I get a warning like this:

Bundled and transpiled successfully, but with warnings: The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten

Is there any option to have the same custom (reduced) build, but suitable to be imported in modules and then available through '_' as always?

Thank you

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

0

You could create your own aggregating module in a local file...such as tools/lodash.js:

export { 
  each, find, filter, map, some, debounce, defer, delay, throttle,
  uniq, assign, extend, merge, omit, without, findIndex, compact, 
  replace, groupBy, max, uniqueId 
} from 'lodash';

Then when you wanted these tools you could add

import * as _ from './tools/lodash`;

If you don't like the import * as _ syntax, you could do a straight import in your aggregating module and then do an export default { each, find, ... };. That would allow you to do import _ from './tools/lodash';.

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