Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add example for adding JS/CSS compressors to an environment
  • Loading branch information
CHH committed Jan 20, 2013
1 parent d058b53 commit 6baad15
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions README.md
Expand Up @@ -159,6 +159,27 @@ Supported CSS Compressors:
using [CSSmin](https://github.com/yui/ycssmin). Requires the `yuglify`
NPM package.

Example:

```php
<?php

$env = new Environment;
$env->appendPath("assets/stylesheets");
$env->appendPath("assets/vendor/stylesheets");
$env->appendPath("assets/javascripts");
$env->appendPath("assets/vendor/javascripts");

$env->setJsCompressor('yuglify_js');
$env->setCssCompressor('yuglify_css');

# Compressors are Bundle Processors. Bundle Processors are only run on Bundled Assets.
# Pass 'bundled' => true to get a Bundled Asset.
$asset = $env->find('application.js', ['bundled' => true]);

echo $asset->getBody();
```

### Directives

Each file with content type `application/javascript` or `text/css` is
Expand Down

0 comments on commit 6baad15

Please sign in to comment.