refactor: use Tailwind CLI and esbuild for assets

Fixes: #10
Fixes: #14
This commit is contained in:
Oliver Davies 2021-12-29 18:31:46 +00:00
parent aa22925e92
commit 6e120bee3a
15 changed files with 1381 additions and 9904 deletions

18
run
View file

@ -93,6 +93,24 @@ function test:unit {
_dc --entrypoint phpunit app "${@}"
}
function yarn:build:css {
# Build CSS assets, this is meant to be run from within the assets container.
local args=()
if [ "${SCULPIN_ENV}" == "prod" ]; then
args=(--minify)
elif [ "${NODE_ENV}" == "development" ]; then
args=(--watch)
fi
tailwindcss --postcss -i assets/css/tailwind.pcss -o build/app.css "${args[@]}"
}
function yarn:build:js {
# Build JS assets, this is meant to be run from within the assets container.
node esbuild.config.js
}
function _dc {
docker-compose ${DC} ${TTY} "${@}"
}