audriusdob / yii2-minify-view
带有CSS和JS压缩功能的Yii2视图组件
1.9.4
2016-02-23 19:31 UTC
Requires
- mrclay/minify: ~2.2
- yiisoft/yii2: 2.0.*
This package is not auto-updated.
Last update: 2024-09-20 19:50:33 UTC
README
此组件的主要功能是通过“AssetBundle”连接的文件合并和压缩。
代码状态
支持
安装
composer require "rmrevin/yii2-minify-view:~1.9"
配置
<? return [ // ... 'components' => [ // ... 'view' => [ 'class' => '\rmrevin\yii\minify\View', 'enableMinify' => !YII_DEBUG, 'web_path' => '@web', // path alias to web base 'base_path' => '@webroot', // path alias to web base 'minify_path' => '@webroot/minify', // path alias to save minify result 'js_position' => [ \yii\web\View::POS_END ], // positions of js files to be minified 'force_charset' => 'UTF-8', // charset forcibly assign, otherwise will use all of the files found charset 'expand_imports' => true, // whether to change @import on content 'compress_output' => true, // compress result html page 'compress_options' => ['extra' => true], // options for compress ] ] ];