File tree Expand file tree Collapse file tree 5 files changed +27
-16
lines changed
Expand file tree Collapse file tree 5 files changed +27
-16
lines changed Original file line number Diff line number Diff line change 11import type { BuildConfig } from "bun" ;
22import dts from "bun-plugin-dts" ;
3+ import { build } from "esbuild" ;
34
45const defaultBuildConfig : BuildConfig = {
56 entrypoints : [ "./src/index.ts" ] ,
67 outdir : "./dist" ,
78} ;
89
9- await Promise . all ( [
10- Bun . build ( {
11- ...defaultBuildConfig ,
12- plugins : [ dts ( ) ] ,
13- format : "esm" ,
14- naming : "[dir]/[name].js" ,
15- } ) ,
16- Bun . build ( {
17- ...defaultBuildConfig ,
18- format : "cjs" ,
19- naming : "[dir]/[name].cjs" ,
20- } ) ,
21- ] ) ;
10+ // Build ESM version
11+ await Bun . build ( {
12+ ...defaultBuildConfig ,
13+ format : "esm" ,
14+ naming : "[dir]/[name].js" ,
15+ } ) ;
16+
17+ // Build CJS version using esbuild
18+ await build ( {
19+ entryPoints : [ "./src/index.ts" ] ,
20+ outfile : "./dist/index.cjs" ,
21+ format : "cjs" ,
22+ platform : "node" ,
23+ bundle : true ,
24+ } ) ;
25+
26+ // Build type declarations
27+ await Bun . build ( {
28+ ...defaultBuildConfig ,
29+ plugins : [ dts ( ) ] ,
30+ } ) ;
Original file line number Diff line number Diff line change 3636 },
3737 "dependencies" : {
3838 "assert" : " ^2.1.0" ,
39+ "esbuild" : " ^0.24.0" ,
3940 "jsbn" : " ^1.1.0"
4041 }
4142}
Original file line number Diff line number Diff line change 1- import { SrpGroup , knownGroups } from "./srp/srpGroup" ;
2- import { SrpClient } from "./srp/srpClient" ;
3- export { SrpClient , SrpGroup , knownGroups } ;
1+ export * from "./srp" ;
Original file line number Diff line number Diff line change 1+ import { SrpGroup , knownGroups } from "./srpGroup" ;
2+ import { SrpClient } from "./srpClient" ;
3+ export { SrpClient , SrpGroup , knownGroups } ;
You can’t perform that action at this time.
0 commit comments