From ba7a89ef6794f4dc9415f31d87f8da6d00a7590d Mon Sep 17 00:00:00 2001 From: Alex Karle Date: Tue, 26 May 2020 18:47:21 -0400 Subject: [PATCH] gloat: Default to preprod (non-minified) JS, use prod in prod This commit updates gloat.pl to by default use preprod.html and only when MOJO_MODE=production use index.html, which uses the minified javascript. It also updates the restart.sh script to set the variable accordingly so that we send over the smaller bundle in production. --- bin/restart.sh | 4 +++- gloat.pl | 6 +++++- public/index.html | 12 ++++++------ 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/bin/restart.sh b/bin/restart.sh index 0f165f1..bcac487 100755 --- a/bin/restart.sh +++ b/bin/restart.sh @@ -24,7 +24,9 @@ restart() { fi if [ $name = "preprod" ]; then - export PREPROD=1 + export MOJO_MODE=development + else + export MOJO_MODE=production fi printf "%s" "Starting new server... " diff --git a/gloat.pl b/gloat.pl index ed8e336..4cf7b45 100755 --- a/gloat.pl +++ b/gloat.pl @@ -15,7 +15,11 @@ plugin Webpack => {process => [qw(js css sass)]}; get '/' => sub { my $c = shift; - $c->reply->static($ENV{PREPROD} ? 'preprod.html' : 'index.html'); + if ($ENV{MOJO_MODE} && $ENV{MOJO_MODE} eq 'production') { + $c->reply->static('index.html'); + } else { + $c->reply->static('preprod.html'); + } }; get '/tables' => sub { diff --git a/public/index.html b/public/index.html index a449b13..df12b04 100644 --- a/public/index.html +++ b/public/index.html @@ -2,12 +2,12 @@ - + Euchre Live!! - - -
- - + + +
+ + -- libgit2 1.1.1