I haven't seen any answers specifically addressing this. While I did find a workaround, there's a bit of a gap in knowledge or guidance on this one, it seems.
I'm developing a plugin as prescribed in the Craft Docs, where my plugins folder is outside of my Craft folder:
This is working great! After seeing a bunch of code work I ran
composer require in my plugin to add a required package there, and it installed in my
vendor directory for my plugin.
No matter what I tried, though, I kept getting "Class not found" errors for that package's class when I tried to use it in my plugin code.
Only when I ran
composer require on the package in my Craft directory did it work in my plugin.
I can understand why this is happening...but should I be able to work on a plugin outside the Craft directory and keep vendor packages out of the Craft directory until I'm ready to install it? Or is this a necessary workaround while in development?