Let Composer place a Git repo into a custom path How to place git repo to a custom path? I am using composer/Installer. and I have develop a module on git repo. I would like to add it to composer.json but after pull it should be placed web/modules/custom directory. How can i do that.

I added this parts in my composer.json

"repositories": [
    {
        "type": "vcs",
        "url": "https://github.com/miteshmap/axelerant_custom"
    }
],

"require": {
    "miteshmap/axelerant_custom": "*"
},
"extra": {
    "installer-paths": {
        "web/core": ["type:drupal-core"],
        "web/modules/contrib/{$name}": ["type:drupal-module"],
        "web/modules/custom/{$name}": ["type:drupal-module"],
        "web/profiles/contrib/{$name}": ["type:drupal-profile"],
        "web/themes/contrib/{$name}": ["type:drupal-theme"],
        "drush/contrib/{$name}": ["type:drupal-drush"]
    }
}
"require": {
    "composer/installers": "dev-master",
    "miteshmap/axelerant_custom": "*"
},
"extra": {
    "installer-paths": {
        "web/core": ["type:drupal-core"],
        "web/modules/contrib/{$name}": ["type:drupal-module"],
        "web/modules/custom/{$name}": ["type:drupal-custom-module"]
        "web/profiles/contrib/{$name}": ["type:drupal-profile"],
        "web/themes/contrib/{$name}": ["type:drupal-theme"],
        "web/themes/custom/{$name}": ["type:drupal-custom-theme"]
        "drush/contrib/{$name}": ["type:drupal-drush"],
    }
}


We can do that when composer/installers have defined the type and for that a request was merged with master here - https://github.com/composer/installers/pull/269

And to add the new merge of composer/installers into your json. you can update the composer.json as per the The solution proposed here - https://github.com/drupal-composer/drupal-project/pull/118. The same is explained in above code.