michalsn / minifier
Assets minification and versioning library for CodeIgniter 4.
Installs: 27 891
Dependents: 0
Suggesters: 0
Security: 0
Stars: 49
Watchers: 8
Forks: 10
Open Issues: 1
Requires
- php: ^8.1
- matthiasmullie/minify: ^1.3
Requires (Dev)
- codeigniter4/devkit: ^1.0
- codeigniter4/framework: ^4.1
This package is auto-updated.
Last update: 2024-10-18 02:11:56 UTC
README
Asset minification and versioning library for CodeIgniter 4.
Installation
composer require michalsn/minifier
Configuration
Run command:
php spark minify:publish
This command will copy a config file to your app namespace.
Then you can adjust it to your needs. By default, file will be present in app/Config/Minifier.php
.
You should define an array of files that you want to minify, ie:
public $js = [ 'all.min.js' => [ 'jquery-3.7.1.min.js', 'bootstrap-3.3.7.min.js', 'main.js', ] ]; // or / and public $css = [ 'all.min.css' => [ 'bootstrap-3.3.7.min.css', 'font-awesome-4.7.0.min.css', 'main.css', ] ];
This way requesting for a all.min.js
or all.min.css
file will return a minified and combined version of all files in a given array.
Docs
Read the full documentation: https://michalsn.github.io/minifier/