build: simplify build & run process of FE files

use external bun packages to bundle files, run this package in the
build.rs script
This commit is contained in:
Alexander Navarro 2025-04-14 11:50:17 -04:00
parent e379967907
commit 6ee345763f
6 changed files with 40 additions and 77 deletions

View file

@ -1,20 +0,0 @@
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!");