Fork me on GitHub

Munee can be used to minify JavaScript as well as compile CoffeeScript into JavaScript on-the-fly. The only thing you need to do for the CoffeeScript to be comiled is set the extension of your file to .coffee and link it to your document.


Dispatcher Options

These options can be set in the first parameter of the Request class in the dispatcher file. For example:

echo \Munee\Dispatcher::run(new \Munee\Request(array('javascript' => array('packer' => array('fastDecode' => false))));
NameTypeDefaultDescription
packer Array N/A Set options for the Packer Library
The parameters are:
  • encoding (Default: 62) - level of encoding, int or string : 0,10,62,95 or 'None', 'Numeric', 'Normal', 'High ASCII'
  • fastDecode (Default: true) - include the fast decoder in the packed result
  • specialChars (Default: false) - if you flagged your private and local variables in the script

JavaScript Filters

Read here about Asset Filters

Minify Filter

NameValueDescription
minify true Strip all non-essential whitespace.

Minify Example

This would minify the JavaScript file referenced.

<script src="/js/libs/jquery-1.8.1.min.js,/js/libs/bootstrap.min.js,/js/site.js?minify=true"></script>

Packer Filter

NameValueDescription
packer true Run the javascript through the Packer Library.

Note: You can set a couple of different options for Packer above in the Dispatcher Options.

Packer Example

This would pack the JavaScript file referenced.

<script src="/js/site.js?packer=true"></script>

Note: It would probably not be wise to run the javascript through the minify and packer filters at the same time :).