projects
/
gruntmaster-page.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
bcf95b4
)
Do not minify CSS/JS in development
author
Marius Gavrilescu
<marius@ieval.ro>
Wed, 10 Dec 2014 14:16:19 +0000
(16:16 +0200)
committer
Marius Gavrilescu
<marius@ieval.ro>
Wed, 10 Dec 2014 14:16:19 +0000
(16:16 +0200)
lib/Plack/App/Gruntmaster.pm
patch
|
blob
|
blame
|
history
diff --git
a/lib/Plack/App/Gruntmaster.pm
b/lib/Plack/App/Gruntmaster.pm
index c8b04f3873a9bace214ef2620b3e6a87259dc0cf..3cb38097fb8052b76602c7bca35e62a4b58dbbf1 100644
(file)
--- a/
lib/Plack/App/Gruntmaster.pm
+++ b/
lib/Plack/App/Gruntmaster.pm
@@
-52,6
+52,8
@@
use constant FORMAT_EXTENSION => {
use constant NOT_FOUND => [404, ['Content-Type' => 'text/plain'], ['Not found']];
use constant FORBIDDEN => [401, ['Content-Type' => 'text/plain', 'WWW-Authenticate' => 'Basic realm="Gruntmaster 6000"'], ['Forbidden']];
use constant NOT_FOUND => [404, ['Content-Type' => 'text/plain'], ['Not found']];
use constant FORBIDDEN => [401, ['Content-Type' => 'text/plain', 'WWW-Authenticate' => 'Basic realm="Gruntmaster 6000"'], ['Forbidden']];
+sub development() { ($ENV{PLACK_ENV} // 'development') eq 'development' }
+
my $env;
sub db { $env->{'gruntmaster.dbic'} }
my $env;
sub db { $env->{'gruntmaster.dbic'} }
@@
-94,14
+96,14
@@
sub dispatch_request{
my $css = read_file "css/themes/$theme.css";
$css .= read_file $_ for <css/*.css>;
my @headers = ('X-Forever' => 1, 'Cache-Control' => 'public, max-age=604800', 'Content-Type' => 'text/css');
my $css = read_file "css/themes/$theme.css";
$css .= read_file $_ for <css/*.css>;
my @headers = ('X-Forever' => 1, 'Cache-Control' => 'public, max-age=604800', 'Content-Type' => 'text/css');
- [200, \@headers, [CSS::Minifier::XS::minify $css]]
+ [200, \@headers, [
development ? $css :
CSS::Minifier::XS::minify $css]]
},
sub (/js.js) {
my $js;
$js .= read_file $_ for <js/*.js>;
my @headers = ('X-Forever' => 1, 'Cache-Control' => 'public, max-age=604800', 'Content-Type' => 'application/javascript');
},
sub (/js.js) {
my $js;
$js .= read_file $_ for <js/*.js>;
my @headers = ('X-Forever' => 1, 'Cache-Control' => 'public, max-age=604800', 'Content-Type' => 'application/javascript');
- [200, \@headers, [JavaScript::Minifier::XS::minify $js]]
+ [200, \@headers, [
development ? $js :
JavaScript::Minifier::XS::minify $js]]
},
sub (/src/:job) {
},
sub (/src/:job) {
This page took
0.011409 seconds
and
4
git commands to generate.