2

I've learned how to set a custom install-path for a composer package on the project side.

"extra": {
    "installer-paths": {
        "foobar": ["vendor/package"]
    }
}

However, I want to be able to set this dir name for this package on the package side, so in the composer.json file within my package repo. Placing the installer-path key there doesn't affect the installation dir and the package is installed in the default vendor/packagename dir.

How do you set the install path for a package within its own composer.json?

yivi
  • 42,438
  • 18
  • 116
  • 138
Semicolon
  • 1,904
  • 14
  • 26
  • Does this answer your question? [How to set the install directory for a package on the package, instead of on the project?](https://stackoverflow.com/questions/59048491/how-to-set-the-install-directory-for-a-package-on-the-package-instead-of-on-the) – yivi Nov 28 '19 at 13:27

1 Answers1

1

It can be solved by adding installer-name to the extra key in the package's composer.json file.

"extra": {
   "installer-name": "foobar",
}
yivi
  • 42,438
  • 18
  • 116
  • 138
Semicolon
  • 1,904
  • 14
  • 26