]> iEval git - gruntmaster-page.git/blobdiff - make_static.PL
Merge branch 'master' into newmc
[gruntmaster-page.git] / make_static.PL
index 489652a421a4db89db15774b32b758e2f8d95664..4d737fa3d7c330c28a8bb9c477f941c5e9ca2b10 100644 (file)
@@ -6,6 +6,7 @@ use CSS::Minifier::XS qw//;
 use CSS::SpriteMaker;
 use JavaScript::Minifier::XS qw//;
 
+use IO::Compress::Gzip qw/gzip/;
 use File::Slurp qw/read_file write_file/;
 
 mkdir 'static';
@@ -36,6 +37,11 @@ sub make_sprite {
        rename 'static/logos-nq8.png', 'static/logos.png';
 }
 
+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>;
@@ -44,6 +50,7 @@ sub make_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";
        }
 }
 
@@ -58,6 +65,7 @@ sub make_js {
                $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;
This page took 0.02328 seconds and 4 git commands to generate.