By default, dependencies from http://wpackagist.org/ install to /wp-content/plugins
or /wp-content/themes
to mimic the default locations for WordPress but I've previously been able to specify that dependencies from http://wpackagist.org/ should go in a specific directory with the following:
"extra": {
"installer-paths": {
"vendor/{$name}/": ["type:wordpress-plugin"],
"vendor/{$name}/": ["type:wordpress-theme"]
}
}
i.e. to put them in the general /vendor
directory to be treated as code dependecies. However in a new project this is now not working. Similar searches reveal that the type
looks for the value set in the dependency's composer.json
but seeing as WPackagist mirrors the WordPress repository, plugins and themes from WPackagist don't have a composer.json
.
I tried explicitly stating the vendor-dir
but it made no difference but interestingly, setting the installer path for each dependency works as expected, e.g.
"extra": {
"installer-paths": {
"vendor/cmb2/": ["wpackagist-plugin/cmb2"]
}
}
Can anyone see what I'm doing wrong?
The problem is you have two keys with the same name so the second is overwriting the first. Try this instead:
"extra": {
"installer-paths": {
"vendor/{$name}/": ["type:wordpress-plugin", "type:wordpress-theme"]
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With