[Pkg-javascript-commits] [leaflet-markercluster] 48/49: Add patch 2002 to adapt build script to support Uglifyjs 1.x.

Jonas Smedegaard js at moszumanska.debian.org
Tue Jan 28 17:54:49 UTC 2014


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository leaflet-markercluster.

commit 4b40b29475e49ee551eff66e79b6371f09068e4a
Author: Jonas Smedegaard <dr at jones.dk>
Date:   Tue Jan 28 18:41:23 2014 +0100

    Add patch 2002 to adapt build script to support Uglifyjs 1.x.
---
 debian/patches/2002_use_old_uglifyjs.patch | 37 ++++++++++++++++++++++++++++++
 debian/patches/series                      |  1 +
 2 files changed, 38 insertions(+)

diff --git a/debian/patches/2002_use_old_uglifyjs.patch b/debian/patches/2002_use_old_uglifyjs.patch
new file mode 100644
index 0000000..a28ce28
--- /dev/null
+++ b/debian/patches/2002_use_old_uglifyjs.patch
@@ -0,0 +1,37 @@
+Description: adapt build script to support Uglifyjs 1.x.
+Author: Jonas Smedegaard <dr at jones.dk>
+Forwarded: not-needed
+Last-Update: 2014-01-28
+
+--- a/build/build.js
++++ b/build/build.js
+@@ -108,6 +108,17 @@
+ 	return content;
+ }
+ 
++function uglify(code) {
++	var pro = UglifyJS.uglify;
++
++	var ast = UglifyJS.parser.parse(code);
++	ast = pro.ast_mangle(ast, {mangle: true});
++	ast = pro.ast_squeeze(ast);
++	ast = pro.ast_squeeze_more(ast);
++
++	return pro.gen_code(ast) + ';';
++};
++
+ exports.build = function (compsBase32, buildName) {
+ 
+ 	var files = getFiles(compsBase32);
+@@ -138,10 +149,7 @@
+ 
+ 	var path = pathPart + '.js',
+ 	    oldCompressed = loadSilently(path),
+-	    newCompressed = copy + UglifyJS.minify(newSrc, {
+-	        warnings: true,
+-	        fromString: true
+-	    }).code,
++	    newCompressed = copy + uglify(newSrc),
+ 	    delta = getSizeDelta(newCompressed, oldCompressed);
+ 
+ 	console.log('\tCompressed size: ' + newCompressed.length + ' bytes (' + delta + ')');
diff --git a/debian/patches/series b/debian/patches/series
index 490f4b3..615cd91 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 2001-dont-run-jshint-checks.patch
+2002_use_old_uglifyjs.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/leaflet-markercluster.git



More information about the Pkg-javascript-commits mailing list