From bc3eca50cce0e36ab817209c24c6b9d461b83485 Mon Sep 17 00:00:00 2001 From: Jimb Esser Date: Tue, 27 Nov 2012 11:19:35 -0800 Subject: [PATCH] Allow passing arbitrary output options into minify I find myself wanting to set various output options (beautify, indent_level, and comments, specifically), and it would be nice to not have to duplicate the entire minify() function in my code. --- tools/node.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/node.js b/tools/node.js index be3cd93d..2ba5cff3 100644 --- a/tools/node.js +++ b/tools/node.js @@ -95,7 +95,11 @@ exports.minify = function(files, options) { orig: inMap, root: options.sourceRoot }); - var stream = UglifyJS.OutputStream({ source_map: map }); + var output_options = { + source_map: map + }; + UglifyJS.merge(output_options, options.output_options); + var stream = UglifyJS.OutputStream(output_options); toplevel.print(stream); return { code : stream + "",