File tree Expand file tree Collapse file tree 3 files changed +22
-10
lines changed Expand file tree Collapse file tree 3 files changed +22
-10
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' better-ajv-errors ' : patch
3+ ---
4+
5+ Fix exports definition for ESM and CJS types.
Original file line number Diff line number Diff line change @@ -9,16 +9,16 @@ const { copy } = require('esbuild-plugin-copy');
99
1010const isEsmBuild = process . argv [ 2 ] !== '--cjs' ;
1111
12- const copyTypingsPlugin = copy ( {
13- assets : [ { from : [ './typings.d.ts' ] , to : [ './typings.d.ts' ] } ] ,
14- } ) ;
15-
1612const config = {
1713 cjs : {
1814 format : 'cjs' ,
1915 platform : 'node' ,
2016 outdir : './lib/cjs' ,
21- plugins : [ copyTypingsPlugin ] ,
17+ plugins : [
18+ copy ( {
19+ assets : [ { from : [ './typings.d.ts' ] , to : [ './typings.d.ts' ] } ] ,
20+ } ) ,
21+ ] ,
2222 } ,
2323 esm : {
2424 format : 'esm' ,
@@ -39,7 +39,9 @@ const config = {
3939 } ) ;
4040 } ,
4141 } ,
42- copyTypingsPlugin ,
42+ copy ( {
43+ assets : [ { from : [ './typings.d.ts' ] , to : [ './typings.d.mts' ] } ] ,
44+ } ) ,
4345 ] ,
4446 } ,
4547} ;
Original file line number Diff line number Diff line change 66 "main" : " ./lib/cjs/index.js" ,
77 "exports" : {
88 "." : {
9- "require" : " ./lib/cjs/index.js" ,
9+ "import" : {
10+ "types" : " ./lib/esm/typings.d.mts" ,
1011 "default" : " ./lib/esm/index.mjs"
12+ },
13+ "require" : {
14+ "types" : " ./lib/cjs/typings.d.ts" ,
15+ "default" : " ./lib/cjs/index.js"
16+ }
1117 }
1218 },
1319 "module" : " ./lib/esm/index.mjs" ,
2632 " Tong Li"
2733 ],
2834 "license" : " Apache-2.0" ,
29- "types" : " ./typings.d.ts" ,
35+ "types" : " ./lib/cjs/ typings.d.ts" ,
3036 "files" : [
31- " lib" ,
32- " typings.d.ts"
37+ " lib"
3338 ],
3439 "scripts" : {
3540 "prebuild" : " rm -rf lib" ,
You can’t perform that action at this time.
0 commit comments