]>
Commit | Line | Data |
---|---|---|
1 | package Gruntmaster::Page::JS; | |
2 | ||
3 | use 5.014000; | |
4 | use strict; | |
5 | use warnings; | |
6 | use Gruntmaster::Page::Base; | |
7 | our @ISA = qw/Gruntmaster::Page::Base/; | |
8 | our $VERSION = '0.001'; | |
9 | ||
10 | use File::Slurp qw/read_file/; | |
11 | use JavaScript::Minifier::XS qw/minify/; | |
12 | ||
13 | sub generate{ | |
14 | my ($self, $format, $logger) = @_; | |
15 | debug $logger => ""; | |
16 | my $js; | |
17 | $js .= read_file $_ for <js/*.js>; | |
18 | [200, ['Content-Type' => 'application/javascript', 'Cache-Control' => 'public, max-age=604800'], [$js] ] | |
19 | } | |
20 | ||
21 | sub variants{ [[js => 1, 'application/javascript', undef, undef, undef, undef]] } | |
22 | ||
23 | 1 |