zulip/zproject/jinja2/compressors.py

20 lines
492 B
Python
Raw Normal View History

"""
`minified_js` is taken from `zerver.templatetags.minified_js.py`
"""
from typing import Text
2016-08-08 10:59:59 +02:00
from django.conf import settings
from django.template import TemplateSyntaxError
from zerver.templatetags.minified_js import MinifiedJSNode
def minified_js(sourcefile):
# type: (str) -> Text
if sourcefile not in settings.JS_SPECS:
raise TemplateSyntaxError(
"Invalid argument: no JS file %s".format(sourcefile))
return MinifiedJSNode(sourcefile).render({})