Hello,
When use the library from JavaScript, one can specify the file name to read code from. For example, for "minify" function:
var result = UglifyJS.minify("/path/to/file.js");
Thus, usually a dev doesn't care about manual reading code from the file.
On the contrary, the library doesn't support saving compressed code string to a file. Hence, if the developer needs minified code to be writen in the output file then he/she will also add something like:
// Output to a file
var fs = require('fs');
fs.writeFile(""/path/to/output/file.js", result.code, function(err) {
if(err) {
console.log(err);
} else {
console.log("The file was saved!");
}
});
I propose to add an appropriate option to output object which a programmer may pass as an argument to emit an output file with compressed result code.
Thanks,
Anna.
Hello,
When use the library from JavaScript, one can specify the file name to read code from. For example, for "minify" function:
var result = UglifyJS.minify("/path/to/file.js");
Thus, usually a dev doesn't care about manual reading code from the file.
On the contrary, the library doesn't support saving compressed code string to a file. Hence, if the developer needs minified code to be writen in the output file then he/she will also add something like:
// Output to a file
var fs = require('fs');
fs.writeFile(""/path/to/output/file.js", result.code, function(err) {
if(err) {
console.log(err);
} else {
console.log("The file was saved!");
}
});
I propose to add an appropriate option to output object which a programmer may pass as an argument to emit an output file with compressed result code.
Thanks,
Anna.