frontend/config/assets/compress.php
<?php
/*
* This file is part of the HomeFinanceV2 project.
*
* (c) Rafalsky.com <http://github.com/Rafalsky/>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
* Configuration file for the "yii asset" console command.
* @author Eugene Terentev <eugene@terentev.net>
*/
// In the console environment, some path aliases may not exist. Please define these:
Yii::setAlias('@webroot', Yii::getAlias('@frontend/web'));
Yii::setAlias('@web', '/');
return [
// Adjust command/callback for JavaScript files compressing:
'jsCompressor' => 'uglifyjs {from} -o {to}',
// Adjust command/callback for CSS files compressing:
'cssCompressor' => 'yuicompressor --type css {from} -o {to}',
// The list of asset bundles to compress:
'bundles' => [
'frontend\assets\FrontendAsset',
'yii\web\YiiAsset',
'yii\web\JqueryAsset',
],
// Asset bundle for compression output:
'targets' => [
'all' => [
'class' => 'yii\web\AssetBundle',
'basePath' => '@webroot',
'baseUrl' => '@web',
'js' => 'bundle/{hash}.js',
'css' => 'bundle/{hash}.css',
],
],
// Asset manager configuration:
'assetManager' => [
'basePath' => '@webroot/assets',
'baseUrl' => '@web/assets'
],
];