5 use CSS
::Minifier
::XS qw
//;
6 use JavaScript
::Minifier
::XS qw
//;
8 use File
::Slurp qw
/read_file write_file/;
15 $common_css .= read_file
$_ for <css
/*.css
>;
16 for (<css
/themes/*>) {
17 my ($theme) = m
,themes
/(.*)\
.css
,;
18 my $css = read_file
$_;
20 write_file
"static/css/$theme.css", CSS
::Minifier
::XS
::minify
$css;
25 if (-f
'compiler.jar') {
26 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/*>;
27 my $js = read_file
'static/js.js';
28 write_file
'static/js.js', '//# sourceMappingURL=/static/js.map', "\n", $js;
29 system 'cp', '-rp', 'js', 'static/';
32 $js .= read_file
$_ for <js
/*.js
>;
33 write_file
'static/js.js', JavaScript
::Minifier
::XS
::minify
$js;
37 my $css_mtime = -M
'static/css/slate.css' // 0;
38 for (<css
/*>, <css
/themes
/*>) {
39 if (!$css_mtime || $css_mtime > -M
) {
45 my $js_mtime = -M
'static/js.js' // 0;
47 if (!$js_mtime || $js_mtime > -M
) {