refactor(web): migrate to Bun and TypeScript with README screenshots
This commit is contained in:
parent
87372041dd
commit
d6a9745df0
28 changed files with 3152 additions and 386 deletions
18
scripts/browser.ts
Normal file
18
scripts/browser.ts
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
import { fileURLToPath } from "node:url";
|
||||
|
||||
export async function browserBundle(minify = false): Promise<Blob> {
|
||||
const result = await Bun.build({
|
||||
entrypoints: [fileURLToPath(new URL("../src/app.ts", import.meta.url))],
|
||||
target: "browser",
|
||||
format: "esm",
|
||||
minify,
|
||||
sourcemap: "none",
|
||||
});
|
||||
if (!result.success || !result.outputs[0]) {
|
||||
throw new AggregateError(
|
||||
result.logs,
|
||||
"Browser TypeScript compilation failed",
|
||||
);
|
||||
}
|
||||
return result.outputs[0];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue