File tree Expand file tree Collapse file tree 2 files changed +18
-20
lines changed
Expand file tree Collapse file tree 2 files changed +18
-20
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @bomb.sh/tools " : patch
3+ ---
4+
5+ Updates ` tsdown ` entrypoint (defaults to ` src ` )
Original file line number Diff line number Diff line change 11import { parse } from "@bomb.sh/args" ;
2- import { x } from "tinyexec " ;
2+ import { build as tsdown } from "tsdown " ;
33import type { CommandContext } from "../context.ts" ;
4- import { local } from "../utils.ts" ;
54
65export 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}
You can’t perform that action at this time.
0 commit comments