diff options
author | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2007-06-14 22:06:00 +0000 |
---|---|---|
committer | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2007-06-14 22:06:00 +0000 |
commit | f621f92a4d2df47b9f1568d6973e21a019203b93 (patch) | |
tree | bc87d468243252b1abec510628612dfbf3d0d0d2 /build | |
parent | a6b91166afd2c5030f13f5a35aa078f4b3394ceb (diff) | |
download | jquery-f621f92a4d2df47b9f1568d6973e21a019203b93.tar.gz jquery-f621f92a4d2df47b9f1568d6973e21a019203b93.zip |
Modified min build to include (like pack) the license header, thanks John for the regex
Diffstat (limited to 'build')
-rw-r--r-- | build/build/min.js | 10 | ||||
-rw-r--r-- | build/build/pack.js | 2 |
2 files changed, 9 insertions, 3 deletions
diff --git a/build/build/min.js b/build/build/min.js index cb7788aa4..5707d4afb 100644 --- a/build/build/min.js +++ b/build/build/min.js @@ -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 ); diff --git a/build/build/pack.js b/build/build/pack.js index 6a04e7224..e50dec972 100644 --- a/build/build/pack.js +++ b/build/build/pack.js @@ -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; |