Skip to content
Browse files

Add example for adding JS/CSS compressors to an environment

  • Loading branch information...
1 parent d058b53 commit 6baad15acf6da583a71babe3dbc53c98b909cc3f @CHH committed Jan 20, 2013
Showing with 21 additions and 0 deletions.
  1. +21 −0 README.md
View
21 README.md
@@ -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

0 comments on commit 6baad15

Please sign in to comment.
Something went wrong with that request. Please try again.