Skip to content

Commit

Permalink
minimify css and js in whole /local directory for prod and dev sites
Browse files Browse the repository at this point in the history
  • Loading branch information
paskal committed Jun 18, 2023
1 parent 51f57e1 commit c8e8035
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion config/cron/host.cron
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ INFRA_DIR=/web
5 1,9,17 * * * admin cd $INFRA_DIR && ./scripts/update-dns-token.sh >/dev/null 2>&1

# minify js and css files. rev-cut-rev magic is to remove the file extension.
* * * * * root docker run -v /web/web/dev/local/templates/light:/www/dev -v /web/web/prod/local/templates/light:/www/prod tdewolff/minify sh -c "find /www -name '*.js' ! -name '*.min.*' | rev | cut -f 2- -d '.' | rev | xargs -I{} minify --preserve -o {}.min.js {}.js"; docker run -v /web/web/dev/local/templates/light:/www/dev -v /web/web/prod/local/templates/light:/www/prod tdewolff/minify sh -c "find /www -name '*.css' ! -name '*.min.*' | rev | cut -f 2- -d '.' | rev | xargs -I{} minify --preserve -o {}.min.css {}.css"
* * * * * root docker run -v /web/web/dev/local:/www/dev -v /web/web/prod/local:/www/prod tdewolff/minify sh -c "find /www -name '*.js' ! -name '*.min.*' | rev | cut -f 2- -d '.' | rev | xargs -I{} minify --preserve -o {}.min.js {}.js"; docker run -v /web/web/dev/local:/www/dev -v /web/web/prod/local:/www/prod tdewolff/minify sh -c "find /www -name '*.css' ! -name '*.min.*' | rev | cut -f 2- -d '.' | rev | xargs -I{} minify --preserve -o {}.min.css {}.css"

# cleanup docker runs after 60*24=1440 runs of docker a day in the minimify command
10 3 * * * root docker system prune -f
Expand Down

0 comments on commit c8e8035

Please sign in to comment.