Yii2 asset compression using closure compiler and yuicompresser -


http://www.yiiframework.com/doc-2.0/guide-structure-assets.html

i generate assets.php in root of application using command yii asset/template assets.php

assets.php

            <?php             /**              * configuration file "yii asset" console command.              */              // in console environment, path aliases may not exist. please define these:             // yii::setalias('@webroot', __dir__ . '/../web');             // yii::setalias('@web', '/');              return [                 // adjust command/callback javascript files compressing:                 'jscompressor' => 'java -jar compiler.jar --js {from} --js_output_file {to}',                 // adjust command/callback css files compressing:                 'csscompressor' => 'java -jar yuicompressor.jar --type css {from} -o {to}',                 // list of asset bundles compress:                 'bundles' => [                     // 'app\assets\appasset',                     // 'yii\web\yiiasset',                     // 'yii\web\jqueryasset',                 ],                 // asset bundle compression output:                 'targets' => [                     'all' => [                         'class' => 'yii\web\assetbundle',                         'basepath' => 'c:/wamp/www/flywings/frontend/web/assets',                         'baseurl' => '/flywings/frontend/web/assets',                         'js' => 'js/all-{hash}.js',                         'css' => 'css/all-{hash}.css',                     ],                 ],                 // asset manager configuration:                 'assetmanager' => [                     //'basepath' => '@webroot/assets',                     //'baseurl' => '@web/assets',                 ],             ]; 

and installed closure compiler , yuicompresser in pc @ following path c:\closure-compiler , c:\yui\yuicompressor\build

and dont know how proceed next step.in assets.php whats {from} {to} , how add bundles there(manually ?).i using advanced application.


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -