rmrevin / yii2-minify-view
Yii2 View component with auto minification css & js in runtime
Installs: 247 361
Dependents: 15
Suggesters: 0
Security: 0
Stars: 190
Watchers: 14
Forks: 67
Open Issues: 10
Type:yii2-extension
Requires
- mrclay/minify: ^3.0
- yiisoft/yii2: ^2.0
- dev-master
- 2.0.0
- 1.15.1
- 1.15.0
- 1.14.4
- 1.14.3
- 1.14.2
- 1.14.1
- 1.14.0
- 1.13.0
- 1.12.2
- 1.12.1
- 1.12.0
- 1.11.0
- 1.10.2
- 1.10.1
- 1.10.0
- 1.9.4
- 1.9.3
- 1.9.2
- 1.9.1
- 1.9.0
- 1.8.6
- 1.8.5
- 1.8.4
- 1.8.3
- 1.8.2
- 1.8.1
- 1.8.0
- 1.7.8
- 1.7.7
- 1.7.6
- 1.7.5
- 1.7.4
- 1.7.3
- 1.7.2
- 1.7.1
- 1.7.0
- 1.6.2
- 1.6.1
- 1.6.0
- 1.5.4
- 1.5.3
- 1.5.2
- 1.5.1
- 1.5.0
- 1.4.2
- 1.4.1
- 1.4.0
- 1.3.1
- 1.3.0
- 1.2.3
- 1.2.2
- 1.2.1
- 1.2.0
- 1.1.0
- 1.0.0
- dev-dependabot/composer/yiisoft/yii2-2.0.38
- dev-matt
This package is not auto-updated.
Last update: 2024-12-21 16:05:13 UTC
README
The main feature of this component - concatenate and compress files connected through "AssetBundle".
Code Status
Support
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 ], ] ] ];