File tree Expand file tree Collapse file tree 2 files changed +25
-13
lines changed
Expand file tree Collapse file tree 2 files changed +25
-13
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @bomb.sh/tools " : patch
3+ ---
4+
5+ Adds ` --bundle ` flag to ` build ` command (default is tsdown's ` unbundle ` behavior
Original file line number Diff line number Diff line change 1+ import { parse } from "@bomb.sh/args" ;
12import { x } from "tinyexec" ;
23import type { CommandContext } from "../context.ts" ;
34import { local } from "../utils.ts" ;
45
56export async function build ( ctx : CommandContext ) {
6- const stdio = x ( local ( "tsdown" ) , [
7- "src/bin.ts" ,
8- "--format" ,
9- "esm" ,
10- "--sourcemap" ,
11- "--clean" ,
12- "--unbundle" ,
13- "--no-config" ,
14- ...ctx . args ,
15- ] ) ;
7+ const args = parse ( ctx . args , {
8+ boolean : [ "bundle" ] ,
9+ } ) ;
1610
17- for await ( const line of stdio ) {
18- console . log ( line ) ;
19- }
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" ) ;
21+
22+ const stdio = x ( local ( "tsdown" ) , tsdownArgs ) ;
23+
24+ for await ( const line of stdio ) {
25+ console . log ( line ) ;
26+ }
2027}
You can’t perform that action at this time.
0 commit comments