Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Modified min build to include (like pack) the license header, thanks …
…John for the regex
- Loading branch information
Showing
with
9 additions
and 3 deletions.
- +8 −2 build/build/min.js
- +1 −1 build/build/pack.js
There are no files selected for viewing
| @@ -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 ); |