Make Gruntmaster::Page::Base::variants not need overriding
[gruntmaster-page.git] / lib / Gruntmaster / Page / JS.pm
CommitLineData
7dc32473
MG
1package Gruntmaster::Page::JS;
2
3use 5.014000;
4use strict;
5use warnings;
6use Gruntmaster::Page::Base;
7our @ISA = qw/Gruntmaster::Page::Base/;
8our $VERSION = '0.001';
9
10use File::Slurp qw/read_file/;
11use JavaScript::Minifier::XS qw/minify/;
12
13sub generate{
191f4979
MG
14 my ($self, $format, $env) = @_;
15 debug $env => "";
7dc32473
MG
16 my $js;
17 $js .= read_file $_ for <js/*.js>;
f65bc88e 18 [200, ['Content-Type' => 'application/javascript', 'Cache-Control' => 'public, max-age=604800', 'X-Forever' => 1], [minify $js] ]
7dc32473
MG
19}
20
7dc32473 211
This page took 0.011433 seconds and 4 git commands to generate.