I am creating one module which will contain more then 1 module in it. Is it possible to create single composer file for more then 1 module?
Please let me know is it possible or not. If yes, then it will be more helpful if you can tell me how.
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityYes, with the following directory structure:
- composer.json
- registration.php
- module1/
- module2/
composer.json
contains the reference to registration.php
as usual.
In registration.php
you define the source directories for both modules:
<?php
namespace {
\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::MODULE,
'Company_Module1',
__DIR__ . '/module1'
);
\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::MODULE,
'Company_Module2',
__DIR__ . '/module2'
);
}
The directories module1
and module2
contain the rest of the source files for each module.