miracle2k / django-assets

Django webassets integration.
BSD 2-Clause "Simplified" License
89 stars 79 forks source link

Filter-specific settings not working #13

Closed michaelmior closed 8 years ago

michaelmior commented 11 years ago

Settings like UGLIFY_JS_EXTRA_ARGS don't appear to be working. After a quick browse through the code, it looks like these were never implemented. If that's the case, I'm happy to do that and submit a pull request.

I would suggest using a dictionary such as ASSETS_OPTIONS to avoid polluting the rest of the settings file.

michaelmior commented 11 years ago

Whoops. This is totally my fault. I forgot to clear the cache after changing options.

miracle2k commented 11 years ago

Actually, I wonder if this can't work better. The filters, for the most part, have a standardized interface through which they expose the options they use, so these values could be added to the cache key.

michaelmior commented 11 years ago

That would be great if possible. At minimum, I think it would be nice to have the fact the cache does not depend on filter parameters be documented somewhere.

michaelmior commented 11 years ago

It seems like for ExternalTool and JavaTool adding the arguments given to subprocess to the cache key would solve the issue.

miracle2k commented 11 years ago

But that wouldn't work for filters that don't rely on external binaries. The better way to approach this would be to make Filter.id (which becomes part of the cache key already) include the Filter.options values.