Currently I have a composer-based Drupal project with both third-party and custom modules. Third-party modules are managed by composer without any issues. But I would like my custom modules to declare their dependencies in a
composer.json within their directories, and also have them install when I run
composer install at the root of the project.
composer.json web/ modules/ contrib/ address/ admin_toolbar/ ... custom/ my_module/ composer.json ... my_other_module/ composer.json
- I have the composer merge plugin which works fine for the most part but would like to avoid using it. It has a nasty habit of calling
updateand bumping dependency versions when it shouldn't.
- I've already looked into Composer path repositories. While it does install the dependencies of my custom modules, it also symlinks/copies my custom module into
web/modules/contribwhich is unnecessary because the custom modules are already in the right place in
In the future, I would splinter off these custom modules into their own projects and stored in their own repositories. But for now, they're still housed in the same project as the Drupal site I'm building.
How do I install dependencies declared in the
composer.json of my local custom modules together with everything else?