Skip to content

Commit ccb63b7

Browse files
authored
feat(build): adds --dts and --minify flags to build command (#10)
1 parent b6dfdd5 commit ccb63b7

File tree

2 files changed

+19
-12
lines changed

2 files changed

+19
-12
lines changed

.changeset/slick-steaks-sneeze.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+
Adds `--dts` and `--minify` flags to `build` command

src/commands/build.ts

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,20 @@ import { build as tsdown } from "tsdown";
33
import type { CommandContext } from "../context.ts";
44

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

10-
const entry = args._.length > 0 ? args._.map(String) : ["src/**/*.ts"];
10+
const entry = args._.length > 0 ? args._.map(String) : ["src/**/*.ts"];
1111

12-
await tsdown({
13-
config: false,
14-
entry,
15-
format: "esm",
16-
sourcemap: true,
17-
clean: true,
18-
unbundle: !args.bundle,
19-
});
12+
await tsdown({
13+
config: false,
14+
entry,
15+
format: "esm",
16+
sourcemap: true,
17+
clean: true,
18+
unbundle: !args.bundle,
19+
dts: args.dts,
20+
minify: args.minify,
21+
});
2022
}

0 commit comments

Comments
 (0)