generated from alecodes/base-template
43 lines
1 KiB
Makefile
43 lines
1 KiB
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 --no-vcs-ignore --clear --restart --watch=dist --watch=src cargo run
|
|
|
|
migrate: (docker-compose "run dbmate migrate")
|
|
|
|
rollback: (docker-compose "run dbmate rollback")
|
|
|
|
build-frontend-watch:
|
|
watchexec --restart --watch frontend just build-frontend
|
|
|
|
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!");
|