1. Go to this page and download the library: Download codesleeve/asset-pipeline library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
'filters' => array(
'.min.js' => array(
),
'.min.css' => array(
new Codesleeve\AssetPipeline\Filters\URLRewrite,
),
'.js' => array(
new EnvironmentFilter(new Codesleeve\AssetPipeline\Filters\JSMinPlusFilter, App::environment()),
),
'.js.coffee' => array(
new Codesleeve\AssetPipeline\Filters\CoffeeScript,
new EnvironmentFilter(new Codesleeve\AssetPipeline\Filters\JSMinPlusFilter, App::environment()),
),
'.coffee' => array(
new Codesleeve\AssetPipeline\Filters\CoffeeScript,
new EnvironmentFilter(new Codesleeve\AssetPipeline\Filters\JSMinPlusFilter, App::environment()),
),
'.css' => array(
new Codesleeve\AssetPipeline\Filters\URLRewrite,
new EnvironmentFilter(new Codesleeve\AssetPipeline\Filters\CssMinFilter, App::environment()),
),
'.css.less' => array(
new Assetic\Filter\LessphpFilter,
new Codesleeve\AssetPipeline\Filters\URLRewrite,
new EnvironmentFilter(new Codesleeve\AssetPipeline\Filters\CssMinFilter, App::environment()),
),
'.css.scss' => array(
new Assetic\Filter\ScssphpFilter,
new Codesleeve\AssetPipeline\Filters\URLRewrite,
new EnvironmentFilter(new Codesleeve\AssetPipeline\Filters\CssMinFilter, App::environment()),
),
'.less' => array(
new Assetic\Filter\LessphpFilter,
new Codesleeve\AssetPipeline\Filters\URLRewrite,
new EnvironmentFilter(new Codesleeve\AssetPipeline\Filters\CssMinFilter, App::environment()),
),
'.scss' => array(
new Assetic\Filter\ScssphpFilter,
new Codesleeve\AssetPipeline\Filters\URLRewrite,
new EnvironmentFilter(new Codesleeve\AssetPipeline\Filters\CssMinFilter, App::environment()),
),
'.html' => array(
new Codesleeve\AssetPipeline\Filters\JST,
new EnvironmentFilter(new Codesleeve\AssetPipeline\Filters\JSMinPlusFilter, App::environment()),
)
),
'cache' => array(), // add 'production' here if you want to cache permanently
'cache_server' => new Assetic\Cache\FilesystemCache(App::make('path.storage') . '/cache/asset-pipeline'),
class MyAwesomeDirective extends Codesleeve\Sprockets\Directives\RequireFile
{
public function process($param)
{
$files = array();
if (App::environment() === 'local' && $param == 'foobar')
{
// do chicken dance and add some files to array
// also, this needs to be an absolute path to file
$files[] = __DIR__ . '/chicken/dance.js';
}
return $files;
}
}