How to add a package dependency to a shopware 6 plugin?

How do I add a package to my shopware 6 plugin?
I want to create an extension to the current behaviour of uploading media files. That’s why I want to install this composer package in my plugin: GitHub - runelaenen/sw6-media-optimizer: Image Optimizer for Shopware 6 💙

I can do this by running composer require runelaenen/sw6-media-optimizer off course. but this will just install the package in the vendor dir in my plugin. during development I don’t have any access to package classes etc.

Also, when this dependency is listed in the requirements of the composer.json file, it is not possible to install my plugin. As the requirements for this package are not met.

I also tried running composer update in the root directory of my shopware 6 installation. to no effect, the dependency is not installed, or listed during the composer update.

How does this work? how do I get a dependency into shopware that is just a regular github package?