Skip to content

Instantly share code, notes, and snippets.

@julienanquetil
Created February 18, 2019 07:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save julienanquetil/4277cd665f8d95e877205d0119f6dc59 to your computer and use it in GitHub Desktop.
Save julienanquetil/4277cd665f8d95e877205d0119f6dc59 to your computer and use it in GitHub Desktop.
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