Also bundle css with bun so it busts caches

And updates the `build.rs` script so that it also builds a manifest.txt
for css files.
This commit is contained in:
2023-06-29 00:34:09 -04:00
parent ec90069c30
commit 74a205d51e
9 changed files with 53 additions and 22 deletions

View File

@@ -7,18 +7,22 @@ install-frontend:
bun install --cwd frontend
clean-frontend:
rm -rf ./static/js/*
rm -rf ./static/js/* ./static/css/*
build-frontend: clean-frontend
bun build frontend/index.ts \
--outdir ./static/js \
--entry-naming [name]-[hash].[ext] \
bun build frontend/js/index.ts \
--outdir ./static \
--root ./frontend \
--entry-naming [dir]/[name]-[hash].[ext] \
--asset-naming [dir]/[name]-[hash].[ext] \
--minify
build-dev-frontend: clean-frontend
bun build frontend/index.ts \
--outdir ./static/js \
--entry-naming [name]-[hash].[ext]
bun build frontend/js/index.ts \
--outdir ./static \
--root ./frontend \
--entry-naming [dir]/[name]-[hash].[ext] \
--asset-naming [dir]/[name]-[hash].[ext]
touch .frontend-built # triggers watch-backend since static/* is ignored
watch-frontend: install-frontend