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

104
Vistas
How should I load/bundle js libraries needed in 2 indipendent js ES modules?

Ok, I'm relatively new to js modules, I tried to find an answer to this question but till now I didn't. I was used to pack all the dependencies in one big js file, shared between several pages. I then loaded another page-specific js file after the shared 'bundle'.

all-pages: shared.js // browser-cached

page-1: page-1-specific.js, loaded after shared.js, uses libraries in shared.js
page-2: page-2-specific.js, loaded after shared.js, uses libraries in shared.js
etc..

Now with modules, if I try to pack several libraries this way, they won't be available to other js files, since anything inside a module can't be 'global' to the page. Ok.

So I should import dependency libraries on any page-specific js. But this way I would have libraries loaded in every page instead of taking advantage of broeser caching.

So what exactly is the way of doing this with es modules nowadays?

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