Since all the modules are separate composer packages, I think you can disable them in composer.json
. What I will describe is not a good solution, and it is kind of a hack.
First of all, I have installed Magento 2 with the following command,
composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition magento2.2
Secondly, I have removed modules you mentioned from vendor directory via the following command.
rm -Rf vendor/magento/module-bundle*
Then, I have added the following part into composer.json
right after the require field.
"replace": {
"magento/module-bundle": "100.2.0",
"magento/module-bundle-import-export": "100.2.0"
},
So, this will say composer that those packages are already provided by your application. As a result, composer will not bother to install them again, since it is trusting what you say (We lied :().
After that you can run composer install
or composer update
again, and you won't see these packages in your vendor directory.
The final version of my composer.json
file
{
"name": "magento/project-community-edition",
"description": "eCommerce Platform for Growth (Community Edition)",
"type": "project",
"version": "2.2.0",
"license": [
"OSL-3.0",
"AFL-3.0"
],
"require": {
"magento/product-community-edition": "2.2.0",
"composer/composer": "@alpha"
},
"replace": {
"magento/module-bundle": "100.2.0",
"magento/module-bundle-import-export": "100.2.0"
},
"require-dev": {
"phpunit/phpunit": "~6.2.0",
"squizlabs/php_codesniffer": "3.0.1",
"phpmd/phpmd": "@stable",
"pdepend/pdepend": "2.5.0",
"friendsofphp/php-cs-fixer": "~2.1.1",
"lusitanian/oauth": "~0.8.10",
"sebastian/phpcpd": "2.0.4"
},
"autoload": {
"psr-4": {
"Magento\\Framework\\": "lib/internal/Magento/Framework/",
"Magento\\Setup\\": "setup/src/Magento/Setup/",
"Magento\\": "app/code/Magento/"
},
"psr-0": {
"": [
"app/code/"
]
},
"files": [
"app/etc/NonComposerComponentRegistration.php"
],
"exclude-from-classmap": [
"**/dev/**",
"**/update/**",
"**/Test/**"
]
},
"autoload-dev": {
"psr-4": {
"Magento\\Sniffs\\": "dev/tests/static/framework/Magento/Sniffs/",
"Magento\\Tools\\": "dev/tools/Magento/Tools/",
"Magento\\Tools\\Sanity\\": "dev/build/publication/sanity/Magento/Tools/Sanity/",
"Magento\\TestFramework\\Inspection\\": "dev/tests/static/framework/Magento/TestFramework/Inspection/",
"Magento\\TestFramework\\Utility\\": "dev/tests/static/framework/Magento/TestFramework/Utility/"
}
},
"minimum-stability": "stable",
"repositories": [
{
"type": "composer",
"url": "https://repo.magento.com/"
}
],
"extra": {
"magento-force": "override"
}
}
EDIT 1:
Actually, this method is used in the official Magento repository. But they are providing those modules in the app/code
directory. The only difference that you won't :).
composer.json
so it does not seem to me that you can prevent them from installing.