yii2-minify-view

Yii2 View component with minification css & js

Github星跟蹤圖

Yii 2 Minify View Component

The main feature of this component - concatenate and compress files
connected through "AssetBundle".

License
Latest Stable Version
Latest Unstable Version
Total Downloads

Code Status

Scrutinizer Code Quality
Code Coverage
Travis CI Build Status
Dependency Status

Support

GutHub issues or public chat.

Installation

The preferred way to install this extension is through composer.

Either run

composer require rmrevin/yii2-minify-view

or add

"rmrevin/yii2-minify-view": "^1.15",

to the require section of your composer.json file.

Configure

<?php

return [
	// ...
	'components' => [
		// ...
		'view' => [
			'class' => '\rmrevin\yii\minify\View',
			'enableMinify' => !YII_DEBUG,
			'concatCss' => true, // concatenate css
			'minifyCss' => true, // minificate css
			'concatJs' => true, // concatenate js
			'minifyJs' => true, // minificate js
			'minifyOutput' => true, // minificate result html page
			'webPath' => '@web', // path alias to web base
			'basePath' => '@webroot', // path alias to web base
			'minifyPath' => '@webroot/minify', // path alias to save minify result
			'jsPosition' => [ \yii\web\View::POS_END ], // positions of js files to be minified
			'forceCharset' => 'UTF-8', // charset forcibly assign, otherwise will use all of the files found charset
			'expandImports' => true, // whether to change @import on content
			'compressOptions' => ['extra' => true], // options for compress
			'excludeFiles' => [
            	'jquery.js', // exclude this file from minification
            	'app-[^.].js', // you may use regexp
            ],
            'excludeBundles' => [
            	\app\helloworld\AssetBundle::class, // exclude this bundle from minification
            ],
		]
	]
];

主要指標

概覽
名稱與所有者rmrevin/yii2-minify-view
主編程語言PHP
編程語言PHP (語言數: 3)
平台
許可證MIT License
所有者活动
創建於2014-03-24 09:12:17
推送於2020-09-15 18:43:52
最后一次提交2020-06-27 14:02:29
發布數56
最新版本名稱2.0.0 (發布於 )
第一版名稱1.0.0 (發布於 )
用户参与
星數189
關注者數13
派生數67
提交數170
已啟用問題?
問題數51
打開的問題數9
拉請求數14
打開的拉請求數1
關閉的拉請求數7
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?