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 );
// 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;