phpdevsr/minifyku
Composer 安装命令:
composer require phpdevsr/minifyku
包简介
Helper versioning and minification your assets in Codeigniter 4
README 文档
README
What is Minifyku?
Minifyku is helper versioning and minification your assets with Codeigniter 4, Can be automatically use base_url().
Installation
install with composer
$ composer require phpdevsr/minifyku
Configuration
$ php spark minifyku: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/Minifyku.php.
public array $js = [ 'all.min.js' => [ 'bootstrap.js', 'jquery.js', 'main.js' ], ]; public array $css = [ 'all.min.css' => [ 'bootstrap.css', 'font-awesome.css', 'main.css' ], ];
This configuration will be minify and combine file bootstrap.js,jquery.js,main.js to all.min.js. Or minify and combine file bootstrap.css,font-awesome.css,main.css to all.min.css.
Since v2.0.0, new option autoMinify for you need automated minify when loaded using helper minifyku() and can be replaced by .env with minifyku.autoMinify = true. Please dont use in production, it will take more time.
public bool $autoMinify = false;
Usage
Run command for minification your all assets:
$ php spark minifyku:minify
or you want minify JS/CSS files:
$ php spark minifyku:minify-js
$ php spark minifyku:minify-css
This will prepare everything and will set up a versioning. Make sure to load a minifier helper in your controller, by calling:
helper('minifyku');
Now to generate a proper tag with desired file to load, you have to make a simple call in your code:
minifyku('all.min.js');
or
minifyku('all.min.css');
Helper will be produce:
<script defer type="text/javascript" src="http://example.com/assets/js/all.min.js?v=bc3d0dc779f1a0b521b69ed3a2b85de8"></script>
or
<link rel="stylesheet" href="http://localhost/assets/css/all.min.css?v=ec8d57dd8de143d7ef822a90fca20957">
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contrib
We does accept and encourage contributions from the community in any shape. It doesn't matter whether you can code, write documentation, or help find bugs, all contributions are welcome.
Made with contrib.rocks.
phpdevsr/minifyku 适用场景与选型建议
phpdevsr/minifyku 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 11.83k 次下载、GitHub Stars 达 5, 最近一次更新时间为 2023 年 04 月 03 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「minification」 「codeigniter」 「minify CSS」 「minify JS」 「codeigniter4」 「minifyku」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 phpdevsr/minifyku 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 phpdevsr/minifyku 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 phpdevsr/minifyku 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Asset Management for PHP
CSS/Javascript Minificator, Compressor and Concatenator for TYPO3 - highly configurable frontend asset optimization for CSS/JS merging, minification and compression with optional body parsing, async/defer loading, inline output, data-ignore exclusions, SRI integrity validation/calculation, external
Caching and compression for Twig assets (JavaScript and CSS).
CSS & JavaScript minifier for Silverstripe
A package for pack css and javascript files
The CodeIgniter Redis package
统计信息
- 总下载量: 11.83k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 15
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-04-03