File tree 5 files changed +27
-16
lines changed
5 files changed +27
-16
lines changed Original file line number Diff line number Diff line change 1
1
import type { BuildConfig } from "bun" ;
2
2
import dts from "bun-plugin-dts" ;
3
+ import { build } from "esbuild" ;
3
4
4
5
const defaultBuildConfig : BuildConfig = {
5
6
entrypoints : [ "./src/index.ts" ] ,
6
7
outdir : "./dist" ,
7
8
} ;
8
9
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 36
36
},
37
37
"dependencies" : {
38
38
"assert" : " ^2.1.0" ,
39
+ "esbuild" : " ^0.24.0" ,
39
40
"jsbn" : " ^1.1.0"
40
41
}
41
42
}
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