How to publish tree-shakable vue components library on npm

Hi all, this is my first attempt to such task so I would be grateful for as detailed information as possible (structure, conditions, tools). I need to create Vue UI library (components & directives) that will be tree-shakable (e.g. user can can use one component from the whole lib and the rest won;t be included into final package). it will be published as npm package. I have the components ready, but if I use vue cli --build lib I receive one file that imports everything.

Package contains:

  • components that share mixins
  • components that uses another UI library (like bootstrap-vue)
  • directives
  • filters
  • some will have child components
  • some uses additional helpers from other js files
  • some of the components will depend on external packages
  • some will use images
    Any help is really welcomed.