mirror of
https://github.com/versia-pub/api.git
synced 2025-12-06 16:38:20 +01:00
26 lines
672 B
TypeScript
26 lines
672 B
TypeScript
import dts from "bun-plugin-dts";
|
|
import ora from "ora";
|
|
|
|
for (const pkg of ["federation", "client"]) {
|
|
const subSpinner = ora(`Building ${pkg} module`).start();
|
|
|
|
await Bun.build({
|
|
entrypoints: [`${pkg}/index.ts`],
|
|
outdir: `${pkg}/dist`,
|
|
format: "esm",
|
|
minify: true,
|
|
sourcemap: "external",
|
|
splitting: true,
|
|
target: "browser",
|
|
plugins: [dts()],
|
|
}).then((output) => {
|
|
if (!output.success) {
|
|
subSpinner.fail(`Failed to build ${pkg} module`);
|
|
console.error(output.logs);
|
|
process.exit(1);
|
|
}
|
|
});
|
|
|
|
subSpinner.succeed(`Built ${pkg} module`);
|
|
}
|