yii2-assets-optimizer Basic unifier and compressor for CSS and JS files inside your Yii2 AssetBundles.

Yii 2 Assets Optimizer

  1. Installation
  2. Configuration/Usage
  3. Additional Options
  4. Next versions

Basic unifier and compressor for CSS and JS files inside your Yii2 AssetBundles. Uses internal server cache to speed up all the process, reducing the time wasting.

View on github/slinstj.

Installation

composer require "slinstj/yii2-assets-optimizer"

Configuration/Usage

return [
    // ...
    'components' => [
        // ...
        'view' => [
            'class' => '\slinstj\assets\optimizer\View',
        ]
    ]
];

Additional Options

return [
    // ...
    'components' => [
        // ...
        'view' => [
            'class' => '\slinstj\assets\optimizer\View',
            'minify' => true, // Or '!YII_DEBUG' for example.
            // Folder where optimized file(s) will be published in:
            'publishPath' => '@webroot/yao',
            // Web acessible url. Must be in accord to 'publishPath':
            'publishUrl' => '@web/yao', 
        ]
    ]
];

Next versions

  • Improve cache by using ChainedDependency - On change JS and CSS files, the optimized file(s) will be regenerated automatically. For now, you should clear the cache manually. Please, check this to know how: cache-flushing.
  • Use events instead of the own View object;
1 0
1 follower
0 downloads
Yii Version: 2.0
License: MIT
Category: Others
Developed by: slinstj
Created on: May 26, 2016
Last updated: 8 years ago

Related Extensions