audriusdob/yii2-minify-view

带有CSS和JS压缩功能的Yii2视图组件

安装: 43

依赖: 0

建议: 0

安全: 0

星星: 0

关注者: 2

分支: 67

类型:yii2-extension

1.9.4 2016-02-23 19:31 UTC

README

此组件的主要功能是通过“AssetBundle”连接的文件合并和压缩。

License Latest Stable Version Latest Unstable Version Total Downloads

代码状态

Scrutinizer Code Quality Code Coverage Travis CI Build Status Dependency Status

支持

GitHub问题公开聊天

安装

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
		]
	]
];