- ## Copy
- print "Copying to : docroot:/$path\n";
- copy( "$opt{tmpl}/web/$path", "$opt{docroot}/$path" ) or die "$path: $!";
-
+ if ( $path =~ /(.+)\.css$/ ) {
+ print "CSS to : docroot:/$path\n";
+ my $content = read_file("$opt{tmpl}/web/$path");
+ write_file( "$opt{docroot}/$path", CSS::Minifier::XS::minify($content) );
+ }
+ elsif ( $path =~ /(.+)\.js$/ ) {
+ print "JS to : docroot:/$path\n";
+ my $content = read_file("$opt{tmpl}/web/$path");
+ write_file( "$opt{docroot}/$path", JavaScript::Minifier::XS::minify($content) );
+ }
+ else {
+ ## Copy
+ print "Copying to : docroot:/$path\n";
+ copy( "$opt{tmpl}/web/$path", "$opt{docroot}/$path" ) or die "$path: $!";
+ }