Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
composer add custom module to magento2
{
"name": "magento/magento2ce",
"description": "Magento 2 My project",
"type": "project",
"version": "2.2.7",
"license": [
"OSL-3.0",
"AFL-3.0"
],
"require": {
"magento/product-community-edition": "2.2.7",
"composer/composer": "@alpha",
"VENDOR/magento2-module-MODULENAME": "VERSION CONSTRAINT"
//....
},
"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": {
"0": {
"type": "composer",
"url": "https://repo.magento.com/"
},
"mycustommodule": {
"type": "vcs",
"url": "https://github.com/mycompany/privaterepo"
}
}
}
{
"name": "VENDOR/magento2-module-MODULENAME",
"license": "OSL-3.0",
"description": "Magento2 custom module",
"require": {
"php": "^7.0|^7.1",
"ext-pcre": "*",
"magento/framework": "^101.0",
"magento/module-backend": "^100.2",
"magento/module-catalog": "^102.0",
"magento/module-store": "^100.2",
"magento/module-eav": "^101.0",
"magento/module-ui": "^101.0",
"magento/module-config": "^101.0",
"psr/log": "^1.1"
},
"type": "magento2-module",
"autoload": {
"files": [
"registration.php"
],
"psr-4": {
"VENDOR\\MODULENAME\\": ""
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.