Skip to content

Commit 51042e9

Browse files
committed
Merge pull request #448 from Alexx-G/fix/js_wrapping_output
Fix for wrapping javascript code.
2 parents 260b127 + 6d915d1 commit 51042e9

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,3 +97,4 @@ or just made Pipeline more awesome.
9797
* Wictor Olseryd <[email protected]>
9898
* Zachary Kazanski <[email protected]>
9999
* Zenobius Jiricek <[email protected]>
100+
* Alex Gavrișco <[email protected]>

docs/configuration.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,9 @@ Wrapped javascript output
253253

254254
All javascript output is wrapped in an anonymous function : ::
255255

256-
(function(){ ... })();
256+
(function(){
257+
//JS output...
258+
})();
257259

258260
This safety wrapper, make it difficult to pollute the global namespace by accident and improve performance.
259261

pipeline/compressors/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def compress_js(self, paths, templates=None, **kwargs):
6060
js = js + self.compile_templates(templates)
6161

6262
if not settings.PIPELINE_DISABLE_WRAPPER:
63-
js = "(function() { %s }).call(this);" % js
63+
js = "(function() {\n%s\n}).call(this);" % js
6464

6565
compressor = self.js_compressor
6666
if compressor:

0 commit comments

Comments
 (0)