Minifier - asset minification and versioning library |
https://github.com/michalsn/minifier
Installation: Code: composer require michalsn/minifier Configuration: PHP Code: public $js = [ Code: php spark minify:js Usage: PHP Code: <?= minifier('all.min.js'); ?>
It's in the "Config/Minifier.php" file. You can run command:
Code: php spark minify:publish to copy the default config file to your application and then modify it to your needs.
hello
i tried this library and used the installation via composer but the function Minifier() is not found "Call to undefined function Minifier()" do you know how to fix it thx
Hi Paul,
You probably need to load a helper in your controller Code: helper('minifier');
this package is good but maybe the Dir config will be upgrade
for me the URL to css is css.mydomaine.com/mycss.css and the dir to css file in php is ../system/assets/css/mycss.css i think the four parameters $baseUrl, $dirJs, $dirCss, $dirVersion would be changed by $UrlJS, $UrlCss, $dirJs, $dirCss, $dirVersion what do you think of that
Well, yes... separate URL config like $cssUrl and $jsUrl might be a good addition if someone would like to serve these files from a separate domain.
Thanks for the idea.
yes and i think it's useful if the public directory is not at the same level of the assets directory
I tried used this package in manual installation mode and all the command php spark minify:* are not found
do you know how to fix it |
Welcome Guest, Not a member yet? Register Sign In |