3

So I'm a bit new to bundle size performance improvements and something I'm trying to do is to reduce the import cost of my component library that's written in TSDX. It's a tool to create Typescript libraries based on rollup.js. I'm using the out of the box setup.

When I investigated my app I found out that the import cost of components from my component library seems to be a lot. See images:

enter image description here

enter image description here

It seems that when I import a single component (or function) there is a lot of other things imported as well. Is there someone out there that knows if this is normal and/or if I can improve this? Maybe someone knows how I can import it like how they do it with the lodash packages where you import a single util from a specific folder like so: import { add } from 'lodash/add'?

So long story short: how can I reduce the import cost of my TSDX (based on rollup.js) library? Thanks in advance!

Giesburts
  • 6,879
  • 15
  • 48
  • 85

0 Answers0