Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

303
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!