use CSS::Minifier::XS qw//;
use JavaScript::Minifier::XS qw//;
+use IO::Compress::Gzip qw/gzip/;
use File::Slurp qw/read_file write_file/;
mkdir 'static';
mkdir 'static/css';
+sub gzip_file {
+ my ($file) = @_;
+ gzip $file => "$file.gz", -Level => 9, Minimal => 1;
+}
+
sub make_css {
my $common_css;
$common_css .= read_file $_ for <css/*.css>;
my $css = read_file $_;
$css .= $common_css;
write_file "static/css/$theme.css", CSS::Minifier::XS::minify $css;
+ gzip_file "static/css/$theme.css";
}
}
$js .= read_file $_ for <js/*.js>;
write_file 'static/js.js', JavaScript::Minifier::XS::minify $js;
}
+ gzip_file 'static/js.js';
}
my $css_mtime = -M 'static/css/slate.css' // 0;