Skip to content

Commit 61c3763

Browse files
committed
fix(build): update entrypoint
1 parent f1ad9a1 commit 61c3763

File tree

2 files changed

+18
-20
lines changed

2 files changed

+18
-20
lines changed

.changeset/gold-moments-marry.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@bomb.sh/tools": patch
3+
---
4+
5+
Updates `tsdown` entrypoint (defaults to `src`)

src/commands/build.ts

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,20 @@
11
import { parse } from "@bomb.sh/args";
2-
import { x } from "tinyexec";
2+
import { build as tsdown } from "tsdown";
33
import type { CommandContext } from "../context.ts";
4-
import { local } from "../utils.ts";
54

65
export async function build(ctx: CommandContext) {
7-
const args = parse(ctx.args, {
8-
boolean: ["bundle"],
9-
});
6+
const args = parse(ctx.args, {
7+
boolean: ["bundle"],
8+
});
109

11-
const tsdownArgs = [
12-
"src/bin.ts",
13-
"--format",
14-
"esm",
15-
"--sourcemap",
16-
"--clean",
17-
"--no-config",
18-
...args._.map((v) => v.toString()),
19-
];
20-
if (!args.bundle) tsdownArgs.push("--unbundle");
10+
const entry = args._.length > 0 ? args._.map(String) : ["src"];
2111

22-
const stdio = x(local("tsdown"), tsdownArgs);
23-
24-
for await (const line of stdio) {
25-
console.log(line);
26-
}
12+
await tsdown({
13+
config: false,
14+
entry,
15+
format: "esm",
16+
sourcemap: true,
17+
clean: true,
18+
unbundle: !args.bundle,
19+
});
2720
}

0 commit comments

Comments
 (0)