diff --git a/README.textile b/README.textile index 937aa59..9f3ea38 100644 --- a/README.textile +++ b/README.textile @@ -14,6 +14,20 @@ sudo gem install closure-compiler h2. Usage +h3. Rails + +In `config/environments/production.rb`: +
+config.assets.js_compressor = Closure::Compiler.new ++ +Specifically for ECMAScript6 support, use this instead: +
+config.assets.js_compressor = Closure::Compiler.new(language_in: 'ECMASCRIPT6') ++ +h3. General + The @Closure::Compiler@ has a @compile@ method, which can be passed a string or an open @IO@ object, and returns the compiled JavaScript. The result is returned as a string, or, if a block is passed, yields as an @IO@ object for streaming writes.