From 94cdc9c0e7483663dea2a32271079d07e7ddb610 Mon Sep 17 00:00:00 2001 From: fjwillemsen Date: Tue, 9 Aug 2022 13:52:35 +0200 Subject: [PATCH] Internal URL redirection for login pages and minification and compression for the JS bundle --- compile-all.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/compile-all.sh b/compile-all.sh index 3a226ab..804ee4a 100755 --- a/compile-all.sh +++ b/compile-all.sh @@ -5,9 +5,13 @@ echo cd Scripts echo "Bundling scripts" /bin/bash bundle_scripts.sh -echo cd .. +# minify the bundled_script.js file +echo "Minifying bundled script" +terser bundled_script.js --compress --output bundled_script.js # use --timings to see how long each step takes +echo + # Setup variables echo echo "--------" @@ -18,8 +22,8 @@ appversion="--app-version $appversionnumber" epochtime=$(date +%s) buildversion="--build-version $appversionnumber.$epochtime" script="--inject bundled_script.js" -# internalurls="--internal-urls \".*?(login|profile|engine|auth.*)\..*?(?\.\w+?)(?:$|\/)\"" # matches all *(login|profile|engine|auth*).*. URLs until the first forward-slash, may be a too greedy because it will also match slugs (e.g. domain.com/login.file.html) -basecommand="nativefier https://overleaf.com $destination $name $appversion $buildversion $script --overwrite" +internalurls="--internal-urls .*?(login|profile|engine|auth.*)\..*?(?\.\w+?)(?:$|\/)" # matches all *(login|profile|engine|auth*).*. URLs until the first forward-slash, may be a too greedy because it will also match slugs (e.g. domain.com/login.file.html) +basecommand="nativefier https://overleaf.com $destination $name $appversion $buildversion $internalurls $script --overwrite" # function to compile while filtering the nativefier output so only relevant output remains function compile() {