File tree Expand file tree Collapse file tree 3 files changed +24
-13
lines changed Expand file tree Collapse file tree 3 files changed +24
-13
lines changed Original file line number Diff line number Diff line change 10
10
"license" : " MIT" ,
11
11
"type" : " module" ,
12
12
"exports" : {
13
- "./internal" : " ./dist/exports/internal.js"
13
+ "./internal" : {
14
+ "import" : " ./dist/exports/internal.js" ,
15
+ "default" : " ./dist/exports/internal.cjs"
16
+ }
14
17
},
15
18
"typesVersions" : {
16
19
"*" : {
20
23
}
21
24
},
22
25
"bin" : {
23
- "abi-ts" : " ./bin/abi-ts.js "
26
+ "abi-ts" : " ./bin/abi-ts.cjs "
24
27
},
25
28
"files" : [
26
29
" bin" ,
Original file line number Diff line number Diff line change 1
1
import { defineConfig } from "tsup" ;
2
+ import { baseConfig } from "../../tsup.config.base" ;
2
3
3
4
export default defineConfig ( ( opts ) => ( {
5
+ ...baseConfig ( opts ) ,
4
6
entry : [ "src/exports/internal.ts" , "src/bin/abi-ts.ts" ] ,
5
- target : "esnext" ,
6
- format : [ "esm" ] ,
7
- sourcemap : true ,
8
- minify : true ,
9
- // don't generate DTS during watch mode because it's slow
10
- // we're likely using TS source in this mode anyway
11
- dts : ! opts . watch ,
12
- // don't clean during watch mode to avoid removing
13
- // previously-built DTS files, which other build tasks
14
- // depend on
15
- clean : ! opts . watch ,
16
7
} ) ) ;
Original file line number Diff line number Diff line change
1
+ import { Options } from "tsup" ;
2
+
3
+ export function baseConfig ( opts : Options ) : Options {
4
+ return {
5
+ target : "esnext" ,
6
+ format : [ "esm" , "cjs" ] ,
7
+ minify : true ,
8
+ sourcemap : true ,
9
+ // don't generate DTS during watch mode because it's slow
10
+ // we're likely using TS source in this mode anyway
11
+ dts : ! opts . watch ,
12
+ // don't clean during watch mode to avoid removing
13
+ // previously-built DTS files, which other build tasks
14
+ // depend on
15
+ clean : ! opts . watch ,
16
+ } ;
17
+ }
You can’t perform that action at this time.
0 commit comments