var esprima = require('esprima');
var esmangle = require('esmangle');
var escodegen = require('escodegen');

Blend.defineClass('Minify', {
    singleton: true,
    js: function (scripts) {
        var ast = esprima.parse(scripts.join(';'));
        var optimized = esmangle.optimize(ast, null);
        var result = esmangle.mangle(optimized);
        result = escodegen.generate(result, {
            format: {
                renumber: true,
                hexadecimal: true,
                escapeless: true,
                compact: true,
                semicolons: false,
                parentheses: false
            }
        });
        return result.toString();
    }
});
var esprima = require('esprima');
var esmangle = require('esmangle');
var escodegen = require('escodegen');

Blend.defineClass('Minify', {
    singleton: true,
    js: function (scripts) {
        var ast = esprima.parse(scripts.join(';'));
        var optimized = esmangle.optimize(ast, null);
        var result = esmangle.mangle(optimized);
        return escodegen.generate(result, {
            format: {
                renumber: true,
                hexadecimal: true,
                escapeless: true,
                compact: true,
                semicolons: false,
                parentheses: false
            }
        });
    }
});
Update to return the correct mangled string
Update to return the correct mangled string
