var es = require('event-stream'),
		uglify = require('uglify-js'),
		clone = require('clone');

module.exports = function() {
	'use strict';
	function minify(file, callback) {
		var newFile = clone(file);
		newFile.contents = new Buffer(uglify.minify(String(file.contents), {fromString: true}).code);

		callback(null, newFile);
	}

	return es.map(minify);
};

var es = require('event-stream'),
		uglify = require('uglify-js');

module.exports = function(opt) {
	'use strict';

	opt = opt || {};
	opt.fromString = true;

	return es.map(function (file, callback) {
		file.contents = new Buffer(uglify.minify(String(file.contents), opt).code);
		callback(null, file);
	});
};

Clone is no longer necessary, allow passing in options
Clone is no longer necessary, allow passing in options
