Skip to content
This repository has been archived by the owner on Jun 16, 2022. It is now read-only.

Commit

Permalink
COMPRESSOR_CLASSES config updates default compressors instead of repl…
Browse files Browse the repository at this point in the history
…acing
  • Loading branch information
alanhamlett committed Oct 21, 2017
1 parent 3c666b4 commit 03b4812
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions jac/contrib/flask.py
Expand Up @@ -90,14 +90,15 @@ def init_app(self, app):
os.path.join(app.static_folder, 'sdist')
app.jinja_env.compressor_static_prefix = app.config.get('COMPRESSOR_STATIC_PREFIX') or \
app.static_url_path + '/sdist'
app.jinja_env.compressor_classes = app.config.get('COMPRESSOR_CLASSES', {
app.jinja_env.compressor_classes = {
'text/css': LessCompressor,
'text/coffeescript': CoffeeScriptCompressor,
'text/less': LessCompressor,
'text/javascript': JavaScriptCompressor,
'text/sass': SassCompressor,
'text/scss': SassCompressor,
})
}
app.jinja_env.compressor_classes.update(app.config.get('COMPRESSOR_CLASSES', {}))
app.jinja_env.compressor_source_dirs = static_finder(app)

def set_compressor(self, mimetype, compressor_cls):
Expand Down

0 comments on commit 03b4812

Please sign in to comment.