compendium/.justfile
aleidk cfaf7ecc1f revert: refactor: build fronend via cli to allow watch mode
this revert e0e8700baa, the build via cli doesn't support plugins
2025-02-21 12:58:11 -03:00

40 lines
968 B
Makefile

# Repo management tasks
mod repo ".devfiles/justfile"
set dotenv-load := true
[private]
docker-compose +ARGS:
docker compose --file .devfiles/docker/docker-compose.dev.yaml --env-file .env --project-name compendium {{ARGS}}
start-dev-services: (docker-compose "up --remove-orphans")
dev:
watchexec --restart --clear --watch src --watch dist cargo run
migrate: (docker-compose "run dbmate migrate")
rollback: (docker-compose "run dbmate rollback")
build-frontend:
#!/usr/bin/env bun
import sassPlugin from "@alecodes/bun-plugin-sass";
const entrypoints = Array.from(
new Bun.Glob("frontend/**/*.html").scanSync(".")
);
const result = await Bun.build({
entrypoints,
outdir: "dist",
publicPath: "/",
splitting: true,
plugins: [sassPlugin],
naming: {
entry: "[dir]/[name].[ext]",
chunk: "assets/[name]-[hash].[ext]",
asset: "assets/[name]-[hash].[ext]",
},
});
console.log("Assets compiled!");