Skip to content

Instantly share code, notes, and snippets.

@theeluwin
Created November 9, 2013 20:12
Show Gist options
  • Select an option

  • Save theeluwin/7389439 to your computer and use it in GitHub Desktop.

Select an option

Save theeluwin/7389439 to your computer and use it in GitHub Desktop.
Wrapping js with closure function for webassets filter
# 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