write_file "static/css/$theme.css", CSS::Minifier::XS::minify $css;
}
-my $js;
-$js .= read_file $_ for <js/*.js>;
-write_file 'static/js.js', JavaScript::Minifier::XS::minify $js;
+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;
+ system 'cp', '-rp', 'js', 'static/';
+} else {
+ my $js;
+ $js .= read_file $_ for <js/*.js>;
+ write_file 'static/js.js', JavaScript::Minifier::XS::minify $js;
+}