Skip to content

Commit 31e7399

Browse files
author
Daniel Dotsenko
committed
build script: adding target for wrapping build into jQuery.NoConflict-safe wrapper.
This is for cases when jQuery-dependent (fromHTML) modules are baked in.
1 parent 916d278 commit 31e7399

1 file changed

Lines changed: 17 additions & 6 deletions

File tree

wscript.py

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,26 @@ def minifyfiles(context):
1616
).replace(
1717
"${commitID}", getCommitIDstring()
1818
) +
19+
#(src - '.js' + '.plugin.from_html.js').text +
20+
#(src - '.js' + '.plugin.sillysvgrenderer.js').text
21+
(src - '.js' + '.plugin.addimage.js').text +
1922
(src - '.js' + '.plugin.standard_fonts_metrics.js').text +
20-
(src - '.js' + '.plugin.split_text_to_size.js').text +
21-
(src - '.js' + '.plugin.addimage.js').text
23+
(src - '.js' + '.plugin.split_text_to_size.js').text
2224
)
23-
2425

25-
26-
minified_amdcompatible = minified - '.min.js' + '.amd.min.js'
27-
minified_amdcompatible.text = ";(function(){" + minified.text + ";define(function(){return jsPDF})})();"
26+
# AMD-compatible version:
27+
(minified - '.min.js' + '.amd.min.js').text = """;(function(){
28+
%s
29+
;define(function(){return jsPDF})})();
30+
""" % minified.text
31+
32+
# jQuery "NoConflict" version:
33+
# only needed if some of the modules compiled into jsPDF need $
34+
# one such module is fromHTML
35+
# (minified - '.min.js' + '.noconflict.min.js').text = """;(function($){
36+
# %s
37+
# })(jQuery);
38+
# """ % minified.text
2839

2940
def docs(context):
3041
'''

0 commit comments

Comments
 (0)