composer-drupal-optimizations
composer-drupal-optimizations copied to clipboard
Does not work with npm-asset repository
With the following composer.json
:
{
"repositories": [
{
"type": "composer",
"url": "https://asset-packagist.org"
}
],
"extra": {
"composer-drupal-optimizations": {
"require": {
"npm-asset/jquery": ">=3.4 <4"
}
}
}
}
Composer still seems to load every jquery version (when running composer show -a npm-asset/jquery
, for example).
I think it is because of this condition: https://github.com/zaporylie/composer-drupal-optimizations/blob/a7f409a765164fd13ac0bd00e19109165c51b369/src/Cache.php#L64
When using npm-asset, $data['packages']
only contains the requested package, so array_diff_key()
returns false here.