Skip to content

Commit

Permalink
Internal URL redirection for login pages and minification and compres…
Browse files Browse the repository at this point in the history
…sion for the JS bundle
  • Loading branch information
fjwillemsen committed Aug 9, 2022
1 parent 2636cc8 commit 94cdc9c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions compile-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 "--------"
Expand All @@ -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.*)\..*?(?<TLD>\.\w+?)(?:$|\/)\"" # matches all *(login|profile|engine|auth*).*.<top-level-domain> 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.*)\..*?(?<TLD>\.\w+?)(?:$|\/)" # matches all *(login|profile|engine|auth*).*.<top-level-domain> 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() {
Expand Down

0 comments on commit 94cdc9c

Please sign in to comment.