]> source.dussan.org Git - jquery.git/commitdiff
Modified min build to include (like pack) the license header, thanks John for the...
authorJörn Zaefferer <joern.zaefferer@gmail.com>
Thu, 14 Jun 2007 22:06:00 +0000 (22:06 +0000)
committerJörn Zaefferer <joern.zaefferer@gmail.com>
Thu, 14 Jun 2007 22:06:00 +0000 (22:06 +0000)
build/build/min.js
build/build/pack.js

index cb7788aa48e001c9b3aa9227bba46aae81c5ea25..5707d4afb2f09b50898385742bc07f2ddf572fac 100644 (file)
@@ -1,5 +1,11 @@
 load("build/js/jsmin.js", "build/js/writeFile.js");
 
-var f = jsmin('', readFile(arguments[0]), 3);
+// arguments
+var inFile = arguments[0];
+var outFile = arguments[1] || inFile.replace(/\.js$/, ".min.js");
 
-writeFile( arguments[1], f );
+var script = readFile(inFile);
+var header = script.match(/\/\*(.|\n)*?\*\//)[0];
+var minifiedScript = jsmin('', script, 3);
+
+writeFile( outFile, header + minifiedScript );
index 6a04e72240748f8cb38ea18b40fbbe9a52be862b..e50dec9727f6788f3820387cce6e21978b59608f 100644 (file)
@@ -5,7 +5,7 @@ load("build/js/Words.js");
 
 // arguments
 var inFile = arguments[0];
-var outFile = arguments[1] || inFile.replace(/\.js$/, "-p.js");
+var outFile = arguments[1] || inFile.replace(/\.js$/, "pack.js");
 
 // options
 var base62 = true;