Commit be0f9fc3 by Timothée Peignier

allow to disable javacsript wrapper

parent 3a103de9
...@@ -205,3 +205,4 @@ All javascript output is wrapped in an anonymous function : :: ...@@ -205,3 +205,4 @@ All javascript output is wrapped in an anonymous function : ::
This safety wrapper, make it difficult to pollute the global namespace by accident and improve performance. This safety wrapper, make it difficult to pollute the global namespace by accident and improve performance.
You can override this behavior by setting ``PIPELINE_DISABLE_WRAPPER`` to ``True``.
...@@ -58,6 +58,8 @@ class Compressor(object): ...@@ -58,6 +58,8 @@ class Compressor(object):
js = self.concatenate(paths) js = self.concatenate(paths)
if templates: if templates:
js = js + self.compile_templates(templates) js = js + self.compile_templates(templates)
if not settings.PIPELINE_DISABLE_WRAPPER:
js = "(function() { %s }).call(this);" % js js = "(function() { %s }).call(this);" % js
compressor = self.js_compressor compressor = self.js_compressor
......
...@@ -23,6 +23,8 @@ PIPELINE_TEMPLATE_NAMESPACE = getattr(settings, 'PIPELINE_TEMPLATE_NAMESPACE', " ...@@ -23,6 +23,8 @@ PIPELINE_TEMPLATE_NAMESPACE = getattr(settings, 'PIPELINE_TEMPLATE_NAMESPACE', "
PIPELINE_TEMPLATE_EXT = getattr(settings, 'PIPELINE_TEMPLATE_EXT', ".jst") PIPELINE_TEMPLATE_EXT = getattr(settings, 'PIPELINE_TEMPLATE_EXT', ".jst")
PIPELINE_TEMPLATE_FUNC = getattr(settings, 'PIPELINE_TEMPLATE_FUNC', "template") PIPELINE_TEMPLATE_FUNC = getattr(settings, 'PIPELINE_TEMPLATE_FUNC', "template")
PIPELINE_DISABLE_WRAPPER = getattr(settings, 'PIPELINE_DISABLE_WRAPPER', False)
PIPELINE_CSSTIDY_BINARY = getattr(settings, 'PIPELINE_CSSTIDY_BINARY', '/usr/local/bin/csstidy') PIPELINE_CSSTIDY_BINARY = getattr(settings, 'PIPELINE_CSSTIDY_BINARY', '/usr/local/bin/csstidy')
PIPELINE_CSSTIDY_ARGUMENTS = getattr(settings, 'PIPELINE_CSSTIDY_ARGUMENTS', '--template=highest') PIPELINE_CSSTIDY_ARGUMENTS = getattr(settings, 'PIPELINE_CSSTIDY_ARGUMENTS', '--template=highest')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment