nevesenin/javascript-packer-perl — Issue #3: Suggested improvement
Author: nigelhorne
Created: 2012-03-07 21:03:47+00:00
State: open

The output of this program:

use JavaScript::Packer;
my $packer = JavaScript::Packer->init();
my $js = << 'OUTPUT';
document.write("foo");
document.write("bar);
OUTPUT
my $foo = $packer->minify(\$js, { compress => 'best' });
print $foo;

is:
document.write("foo");document.write("bar);

wouldn't the "best" compression be:
document.write("foobar");

I realise it would mean that Javascript::Packer would need to have knowledge of what document.write does, nevertheless it could be a useful improvement.