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 1010 "license" : " MIT" ,
1111 "type" : " module" ,
1212 "exports" : {
13- "./internal" : " ./dist/exports/internal.js"
13+ "./internal" : {
14+ "import" : " ./dist/exports/internal.js" ,
15+ "default" : " ./dist/exports/internal.cjs"
16+ }
1417 },
1518 "typesVersions" : {
1619 "*" : {
2023 }
2124 },
2225 "bin" : {
23- "abi-ts" : " ./bin/abi-ts.js "
26+ "abi-ts" : " ./bin/abi-ts.cjs "
2427 },
2528 "files" : [
2629 " bin" ,
Original file line number Diff line number Diff line change 11import { defineConfig } from "tsup" ;
2+ import { baseConfig } from "../../tsup.config.base" ;
23
34export default defineConfig ( ( opts ) => ( {
5+ ...baseConfig ( opts ) ,
46 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 ,
167} ) ) ;
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