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

137
Vistas
How can I configure webpack to include javascript classes that are include via appendChild?

I have some legacy code that import a bunch of js files using document.createElement('script'). I would like to configure webpack to detect all those files and include them into the bundle. Any suggestions about how can I do this?

The legacy code is importing hundreds of js files this way:

["window.js","eventHandler.js", and several others].forEach(filename => {
  const dom = document.createElement('script');
  dom.type = 'text/javascript';
  dom.src = base_path + filename;
  document.head.appendChild(dom);
});

Is there a way I can automatize webpack to detect this old type of import? I would like to avoid have to write manually all the requires since it is a lot of files.

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