refactor: re-structure frontend code

This commit is contained in:
Alexander Navarro 2025-02-19 12:44:09 -03:00
parent 6b7642b693
commit 3e0dd79217
11 changed files with 101 additions and 7 deletions

View file

@ -20,15 +20,21 @@ 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: ["templates/base.html"],
entrypoints,
outdir: "dist",
publicPath: "/",
splitting: true,
plugins: [sassPlugin],
naming: {
entry: "[dir]/[name].[ext]",
chunk: "chunks/[name]-[hash].[ext]",
chunk: "assets/[name]-[hash].[ext]",
asset: "assets/[name]-[hash].[ext]",
},
plugins: [sassPlugin],
});
console.log("Assets compiled!");