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

306
Vistas
Do multiple exports of same code increase bundle size?

I have a folder called types where I store all my typescript types in the same structure as my main project. I store types that are needed in several places in this folder. This is how my types folder looks like:

enter image description here

My other components sometimes need types from several of the files in this folder, so I added index.ts files to import all files in each folder to their respective index.ts file and finally I export all the index.ts files from the main index.ts file in types folder.

This is how index.ts file in utils folder looks like:

export * from './showToast';
export * from './urlGenerator';

This is how main index.ts file looks like:

export * from './components/common';
export * from './services';
export * from './utils';

Everything works perfectly and I can import all my types from the main index.ts file but I was wondering if this exporting of the same types multiple times (once in file itself, once in index.ts file inside respective folder, once in main index.ts file) can increase the bundle size or have any bad effects. I have used this approach for some of my other folders too. So does this approach have any bad effects? I would like to hear your suggestions for structure if this structure is not good.

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