"Shrink" library dependencies

I’m using PIO (PIOArduino actually, if it matters) to develop mostly for the ESP32 platform, and have a question.

When I set a library dependency, is there any good way to “shrink” the stuff it downloads and incorporates into the project? For example I use TFT_eSPI a lot, and it comes with a bunch of examples, extensions, user_setups, etc. that I don’t need and are just taking up extra space.

I suppose I could just go in and delete the files but presumably if the library gets updated or something else triggers it reinstalling, that stuff will all come back. So I’m wondering if there’s a better way to do it?

I see two solutions here:

If it is just about the storage on your harddrive you can use a global version of the library and include it via symlink in the platformio.ini to your project. See Are libraries duplicated? - #2 by sivar2311

If this should also apply to other users of your project I would recommend to create a fork of the library. Then remove the unwanted stuff and use the forked version of the library in your project.