diff --git a/.devfiles/init-bun.ts b/.devfiles/init-bun.ts deleted file mode 100644 index 851977d..0000000 --- a/.devfiles/init-bun.ts +++ /dev/null @@ -1,3 +0,0 @@ -import sassPlugin from "@alecodes/bun-plugin-sass"; - -Bun.plugin(sassPlugin); diff --git a/.justfile b/.justfile index 86cdad8..7192e56 100644 --- a/.justfile +++ b/.justfile @@ -3,10 +3,6 @@ mod repo ".devfiles/justfile" set dotenv-load := true -set shell := ["zsh", "-uc"] - -build_mode := env("BUILD_MODE", "DEVELOPMENT") - [private] docker-compose +ARGS: docker compose --file .devfiles/docker/docker-compose.dev.yaml --env-file .env --project-name compendium {{ARGS}} @@ -14,7 +10,6 @@ docker-compose +ARGS: start-dev-services: (docker-compose "up --remove-orphans") dev: - watchexec --restart --clear --watch src --watch templates cargo run watchexec --restart --clear --watch src --watch dist cargo run migrate: (docker-compose "run dbmate migrate") @@ -22,13 +17,24 @@ migrate: (docker-compose "run dbmate migrate") rollback: (docker-compose "run dbmate rollback") build-frontend: - bun build \ - {{ if uppercase(build_mode) == "DEVELOPMENT" { "--watch" } else { "" } }} \ - --outdir 'dist' \ - --public-path '/' \ - --entry-naming '[dir]/[name].[ext]' \ - --chunk-naming 'assets/[name]-[hash].[ext]' \ - --asset-naming 'assets/[name]-[hash].[ext]' \ - --splitting \ - --css-chunking \ - {{ './frontend/**/*.html' }} + #!/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!"); diff --git a/bunfig.toml b/bunfig.toml index 72ab31b..f694d83 100644 --- a/bunfig.toml +++ b/bunfig.toml @@ -1,5 +1,3 @@ -preload = ["./.devfiles/init-bun.ts"] - [serve.static] plugins = ["bun-plugin-sass"] diff --git a/frontend/css/style.css b/frontend/css/style.css index 9fab7db..818d406 100644 --- a/frontend/css/style.css +++ b/frontend/css/style.css @@ -1,3 +1,3 @@ h1 { - color: blue; + color: red; } diff --git a/frontend/templates/base_1.html b/frontend/templates/base_1.html deleted file mode 100644 index 68fc370..0000000 --- a/frontend/templates/base_1.html +++ /dev/null @@ -1,21 +0,0 @@ - -
- - - -