Re: [flask] arguments to flask assets
- Audrius Kažukauskas
- 2012-12-12 @ 21:17
On Tue, 2012-12-11 at 19:50:11 -0500, Matthew Hoopes wrote:
> I'm trying to find a way to pass arguments to flask assets. Specifically, I
> want to send uglifyjs the -cm flags, and I've read the docs, but I can't
> seem to find the place in flask (or the flask assets environment) to set
> the UGLIFYJS_EXTRA_ARGS to get it to compress and mangle.
This should work:
assets = Environment(app)
# 'uglifyjs_extra_args' requires 'uglifyjs_bin' to be provided as
# well, otherwise it fails with KeyError exception.
assets.config['uglifyjs_bin'] = 'uglifyjs'
assets.config['uglifyjs_extra_args'] = ['-c', '-m']