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

225
Vistas
Get Current Module Scope As Object Webpack

Is there a way to get the current module scope as an object (kind of like this inside a function)

export let num = 5;
export let str = "hello world";
export const set = (name, value) => moduleObj[name] = value;

It is worth mentioning that I don't want to add num and str to a registry object, or other boilerplate like that.

It does not seem to be possible in node (Access NodeJS module scope variables as object) However because webpack packs things into functions, this would normally work. Unforantly, webpack replaces this with undefined when it is top scope. Is there any way I could do this?

about 4 years ago · Juan Pablo Isaza
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