drupal-library-mapping
A helper for installing library assets for Drupal., (*1)
By using Asset Packagist, you can already install Drupal assets into the right location., (*2)
But, what about packages that aren't named the way a Drupal module is expecting?, (*3)
This package both includes common name mappings already, and allows you to specify your
own in composer.json., (*4)
Then, it will symlink, copy, or move the mapped assets to the right location whenever
they are installed or updated., (*5)
How to use the plugin
First, require "bmcclure/drupal-library-mapping"., (*6)
Enable Asset Packagist support following their instructions., (*7)
Configure the following in extra:, (*8)
"installer-types": ["library", "drupal-library", "bower-asset", "npm-asset"],
"installer-paths": {
"libraries/{$name}": [
"type:drupal-library",
"type:bower-asset",
"type:npm-asset"
]
}
Now simply require assets from Asset Packagist, and they'll be mapped appropriately., (*9)
Customizing the copy type
By default, the mapped plugins are copied., (*10)
Add the following to extras to customize the method used for mapping:, (*11)
"drupal-library-mapping-type": "symlink"
Accepted values are "copy" (the default), "symlink", and "move"., (*12)
Note that a side effect of using "move" is that composer will reinstall the package every time it runs., (*13)
Customizing the package name map
You may wish to map other library names to common ones., (*14)
You can add new mappings to the "drupal-library-mapping" key in extras., (*15)
Example:, (*16)
"drupal-library-mapping": {
"jquery-easing-original": "easing"
}