-if (-f 'compiler.jar') {
- system java => -jar => 'compiler.jar', qw,-O SIMPLE --create_source_map static/js.map --js_output_file static/js.js --language_in ECMASCRIPT5_STRICT --source_map_location_mapping js/|/static/js/,, <js/*>;
- my $js = read_file 'static/js.js';
- write_file 'static/js.js', '//# sourceMappingURL=/static/js.map', "\n", $js;
+sub make_css {
+ my $common_css;
+ $common_css .= read_file $_ for <css/*.css>;
+ for (<css/themes/*>) {
+ my ($theme) = m,themes/(.*)\.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";
+ }
+}
+
+sub make_js {
+ system java => -jar => 'compiler.jar', qw,-O SIMPLE --create_source_map static/js/js.map --js_output_file static/js/all.js --language_in ECMASCRIPT6_STRICT --language_out ECMASCRIPT5_STRICT --source_map_location_mapping js/|/static/js/,, <js/*>;
+ my $js = read_file 'static/js/all.js';
+ write_file 'static/js/all.js', '//# sourceMappingURL=/static/js/js.map', "\n", $js;