Skip to content
This repository has been archived by the owner on Nov 20, 2020. It is now read-only.

Pass-on mangle options from app to minifier #10

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions minify.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function precompileError(err, type)
return JSON.stringify(err);
}

function minifyIt(type, content, callback)
function minifyIt(type, options, content, callback)
{
if (typeof callback != 'function')
return;
Expand All @@ -39,7 +39,7 @@ function minifyIt(type, content, callback)
{
case TYPE_JS:

callback(uglifyjs.minify(content, {fromString: true}).code);
callback(uglifyjs.minify(content, {mangle: typeof options.mangle != 'undefined'? options.mangle:{}, fromString: true}).code);

break;

Expand Down Expand Up @@ -329,7 +329,7 @@ module.exports = function express_minify(options)
case TYPE_STYLUS:
case TYPE_COFFEE:

minifyIt(type, buffer.toString(encoding), function(minized)
minifyIt(type, options, buffer.toString(encoding), function(minized)
{
cache_put(sha1, minized, function()
{
Expand Down Expand Up @@ -446,4 +446,4 @@ module.exports = function express_minify(options)

next();
}
};
};