package Gruntmaster::Page::JS;

use 5.014000;
use strict;
use warnings;
use Gruntmaster::Page::Base;
our @ISA = qw/Gruntmaster::Page::Base/;
our $VERSION = '0.001';

use File::Slurp qw/read_file/;
use JavaScript::Minifier::XS qw/minify/;

sub generate{
	my ($self, $format, $logger) = @_;
	debug $logger => "";
	my $js;
	$js .= read_file $_ for <js/*.js>;
	[200, ['Content-Type' => 'application/javascript', 'Cache-Control' => 'max-age=604800'], [$js] ]
}

sub variants{ [[js => 1, 'application/javascript', undef, undef, undef, undef]] }

1
