Permalink
Browse files

Modified min build to include (like pack) the license header, thanks …

…John for the regex
  • Loading branch information...
1 parent a6b9116 commit f621f92a4d2df47b9f1568d6973e21a019203b93 @jzaefferer jzaefferer committed Jun 14, 2007
Showing with 9 additions and 3 deletions.
  1. +8 −2 build/build/min.js
  2. +1 −1 build/build/pack.js
View
@@ -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 );
View
@@ -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;

0 comments on commit f621f92

Please sign in to comment.