mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-15 20:17:22 +00:00
28 lines
716 B
TypeScript
28 lines
716 B
TypeScript
import pkg from "./package.json" with { type: "json" };
|
|
import c from "picocolors";
|
|
import { formatNumber } from "bknd/utils";
|
|
|
|
const deps = Object.keys(pkg.dependencies);
|
|
const external = ["jsonv-ts/*", "wrangler", "bknd", "bknd/*", ...deps];
|
|
|
|
const result = await Bun.build({
|
|
entrypoints: ["./src/cli/index.ts"],
|
|
target: "node",
|
|
outdir: "./dist/cli",
|
|
env: "PUBLIC_*",
|
|
minify: true,
|
|
external,
|
|
define: {
|
|
__isDev: "0",
|
|
__version: JSON.stringify(pkg.version),
|
|
},
|
|
});
|
|
|
|
for (const output of result.outputs) {
|
|
const size_ = await output.text();
|
|
console.info(
|
|
c.cyan(formatNumber.fileSize(size_.length)),
|
|
c.dim(output.path.replace(import.meta.dir + "/", "")),
|
|
);
|
|
}
|