Closed 0528Makoto closed 9 months ago
You could add an option to include all icons of a set in the config, like: 'icons' => '*',
In the sync command you could add:
// skip if icons are not specified
if (! isset($item['icons'])) {
continue;
}
// load all files if * is specified
if ($item['icons'] === '*') {
$item['icons'] = collect(scandir($assetSourcePath))
->filter(fn ($file) => $file !== '.'
&& $file !== '..'
&& str_ends_with($file, '.svg')
)
->map(fn ($file) => str_replace('.svg', '', $file))
->toArray();
}
Summary
Enhancement of the Configuration File (
blade-fontawesome.php
) The configuration file has been refined with the addition of an emptyicons
array to each key. This helps to maintain better structure and clarity in the file.Major upgrade to the
SyncIconsCommand.php
File In a bid to improve synchronization of icons:--only
) has been introduced. This option enables users to sync only the icons they need from the npm package, instead of a full package sync, fostering time and resource optimization.custom
from the$family
array, which makes the array less complicated.Problem
I am using steam laravel to deploy changes to aws through its steam cli, and this in turn compiles and compresses the project for deployment, what happens is that the project is too heavy due to the blade-fontawesome package copies all the svgs even without these are used
My solution
Therefore, I updated the sync of the package so that it only copies the files that I am using in the template
Other posible solution
when deploying list all blade icons in the template and then purge them