nevesenin/javascript-packer-perl — Issue #1: shrink produces javascript that doesn't work
Author: nigelhorne
Created: 2012-01-27 19:32:09+00:00
State: open

Run this program with output to /tmp/foo.htm. Start firefox. Now load file:///tmp/foo.htm. The display box is empty. If you comment out 'do_javascript => 'shrink',' the display box correctly says 'hello, world'.

#!/usr/bin/perl -wT

use JavaScript::Packer;
use HTML::Packer;

my $text = << 'EOF';

EOF

my $packer = HTML::Packer->init();
$body = $packer->minify(\$text, {
remove_comments => 1,
remove_newlines => 1,
do_javascript => 'shrink',
do_stylesheet => 'minify'
});

print $body;