Simplify frontend assests and build steps
We just write the files directly in the public dir Then change the npm scripts to lint and compress them directly
This commit is contained in:
parent
1671323012
commit
ec17f65107
38 changed files with 333 additions and 11358 deletions
3
scripts/build.sh
Executable file
3
scripts/build.sh
Executable file
|
@ -0,0 +1,3 @@
|
|||
#!/usr/bin/env zsh
|
||||
|
||||
echo "Build script"
|
|
@ -1,37 +0,0 @@
|
|||
#!/usr/bin/env zsh
|
||||
|
||||
echo "compressing app.css"
|
||||
zopfli --i100 ./public/assets/css/app.css
|
||||
brotli --force --quality=11 --output=./public/assets/css/app.css.br -- ./public/assets/css/app.css
|
||||
|
||||
echo "compressing js assets"
|
||||
for file in ./public/assets/js/*.js
|
||||
do
|
||||
zopfli --i100 $file
|
||||
brotli --force --quality=11 --output=$file.br -- $file
|
||||
done
|
||||
|
||||
echo "compressing frontend assets"
|
||||
for file in ./public/assets/frontend/*.css
|
||||
do
|
||||
if [[ -f $file ]]; then
|
||||
zopfli --i100 $file
|
||||
brotli --force --quality=11 --output=$file.br -- $file
|
||||
fi
|
||||
done
|
||||
for file in ./public/assets/frontend/a11y.css/*.css
|
||||
do
|
||||
if [[ -f $file ]]; then
|
||||
zopfli --i100 $file
|
||||
brotli --force --quality=11 --output=$file.br -- $file
|
||||
fi
|
||||
done
|
||||
|
||||
echo "compressing highlight styles"
|
||||
for file in ./public/assets/highlight/*.css
|
||||
do
|
||||
if [[ -f $file ]]; then
|
||||
zopfli --i100 $file
|
||||
brotli --force --quality=11 --output=$file.br -- $file
|
||||
fi
|
||||
done
|
16
scripts/compress.sh
Executable file
16
scripts/compress.sh
Executable file
|
@ -0,0 +1,16 @@
|
|||
#!/usr/bin/env zsh
|
||||
|
||||
if ! type brotli &> /dev/null; then
|
||||
echo "brotli not installed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
for file in ./public/assets/css/*.css
|
||||
do
|
||||
brotli --force --quality=11 --output=$file.br -- $file
|
||||
done
|
||||
|
||||
for file in ./public/assets/js/*.js
|
||||
do
|
||||
brotli --force --quality=11 --output=$file.br -- $file
|
||||
done
|
|
@ -1,25 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
echo "Putting the Laravel app in maintenance mode"
|
||||
php artisan down
|
||||
php artisan horizon:terminate
|
||||
|
||||
echo "Pulling the latest changes"
|
||||
git pull
|
||||
|
||||
echo "Updating composer and dependencies"
|
||||
sudo composer self-update
|
||||
composer install --no-dev --optimize-autoloader
|
||||
|
||||
echo "running any migrations"
|
||||
php artisan migrate
|
||||
|
||||
echo "Caching Laravel route and config files"
|
||||
php artisan route:cache
|
||||
php artisan config:cache
|
||||
|
||||
echo "Restarting the supervisord instances"
|
||||
sudo supervisorctl restart all
|
||||
|
||||
echo "Bringing the Laravel app back online"
|
||||
php artisan up
|
|
@ -1,7 +0,0 @@
|
|||
#!/usr/bin/env zsh
|
||||
|
||||
for file in ./public/assets/js/*.js
|
||||
do
|
||||
echo "uglifying `basename $file`"
|
||||
uglifyjs --verbose --compress --source-map content=${file:2}.map,url=`basename $file`.map,filename=${file:2}.map,includeSources=true --output $file $file
|
||||
done
|
Loading…
Add table
Add a link
Reference in a new issue