Created
November 9, 2013 20:12
-
-
Save theeluwin/7389439 to your computer and use it in GitHub Desktop.
Wrapping js with closure function for webassets filter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # define filter | |
| def closure(_in, out, **kw): | |
| out.write('(function(){' + _in.read() + '})()') | |
| # example | |
| bundle = Bundle('sample.js', filters = ('jsmin', closure)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment