定制 rmrevin/yii2-minify-view 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

rmrevin/yii2-minify-view

最新稳定版本:2.0.0

Composer 安装命令:

composer require rmrevin/yii2-minify-view

包简介

Yii2 View component with auto minification css & js in runtime

README 文档

README

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

统计信息

  • 总下载量: 287.84k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 194
  • 点击次数: 2
  • 依赖项目数: 15
  • 推荐数: 0

GitHub 信息

  • Stars: 188
  • Watchers: 13
  • Forks: 69
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-03-24