In Magento2 I see different vendors follow different composer.json formats given below to name their modules.
1st:
"autoload": {
"files": [ "registration.php" ],
"psr-4": {
"Amit\\SamplePage\\": ""
}
}
2nd:
"extra": {
"map": [
[
"*",
"Amit/SamplePage"
]
]
}
1. What's difference between them and which one I should follow?
2. registration.php
is used to to register a module then why composer.json
is needed in all modules ?