Composer plugin for installing assets.
Use Composer:
composer require frontpack/composer-assets-plugin
Library requires PHP 8.0 or later.
composer refresh-assets- refresh files inassetsdirectory
assets-filesin sectionextratrue- symlinks whole package directory- file path - symlinks one file or content of directory
- list of file paths - symlinks files/directories
Example:
{
"extra": {
"assets-files": [
"static/plugin.js",
"static/plugin.css",
"static/icons.png"
]
}
}static/plugin.js- symlinks file toassets/org/package/plugin.jsstatic/plugin.css- symlinks file toassets/org/package/plugin.cssstatic/icons.png- symlinks file toassets/org/package/icons.png
Or you can use simple:
{
"extra": {
"assets-files": "static"
}
}with same result.
assets-dir- directory for installing of assets, defaultassets, relative tovendor-dirassets-directory- alias forassets-dirassets-files- list of asset files in incompatible packages, it overridesassets-filesfrom installed packagesassets-strategy- install strategy for assetsauto- select strategy by platform (default value)copy- copy all assets, default strategy on Windowssymlink- create relative symlinks, default strategy on non-Windows platforms
assets-target- target directory for specific packages, relative tovendor-dir, must be out ofassets-dir
Example:
{
"extra": {
"assets-dir": "public",
"assets-files": {
"org/package": true,
"org/package2": "js/calendar.js",
"org/package3": [
"static/plugin.js",
"static/plugin.css",
"static/icons.png"
]
},
"assets-target": {
"ckeditor/ckeditor": "admin/wysiwyg"
}
}
}org/package- symlinks whole package directory topublic/org/packageorg/package2- symlinks filejs/calendar.jstopublic/org/package2/calendar.jsorg/package3static/plugin.js- symlinks file topublic/org/package3/plugin.jsstatic/plugin.css- symlinks file topublic/org/package3/plugin.cssstatic/icons.png- symlinks file topublic/org/package3/icons.png
ckeditor/ckeditor- symlinks files toadmin/wysiwyg
Plugin provides default mapping for selected incompatible packages. You can override this mapping in your composer.json.
List of packages with default mapping:
bower-asset/tiny-sliderckeditor/ckeditorcomponents/jqueryenyo/dropzonenette/formso5/grido
Some libraries and packages support Composer by default. For other exists shim-repositories:
Always you can search packages on Packagist.
License: New BSD License
Author: Jan Pecha, https://www.janpecha.cz/