1.1.0 • Published 9 years ago
js-packager v1.1.0
What?
js-packager was made to be a simple tool to pack and compress your .js files using uglify-js
How?
install globally: npm install -g js-packager
Create a file with .json extension (pack.json by default, but you can use any other name) at the same folder where your .js scripts are
Your json file should look similar to this:
{
"../scripts.js":{
"header":"(function(w,d,$){$(d).ready(function(){",
"footer":"});})(window,document,jQuery);",
"mangle":true,
"files":[
"./base.js",
"./dois.js"
]
}
}
Options header, footer and mangle are optional:
header can be a part of code that will be inserted before any code
footer can be a part of code that will be inserted after any code
mangle turns mangle on or off (ex: variable name becomes just n, address becomes just a...)
files is a list of files to merge and minify
Run the command "jspack" where your pack.json is located, if you are using other name for your json use: "jspack mypack.json"
The paths of output file and input files are relative to the pack.json (in the case, output.js) will be the merge of all input files