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');
9
9
10
10
const isEsmBuild = process . argv [ 2 ] !== '--cjs' ;
11
11
12
- const copyTypingsPlugin = copy ( {
13
- assets : [ { from : [ './typings.d.ts' ] , to : [ './typings.d.ts' ] } ] ,
14
- } ) ;
15
-
16
12
const config = {
17
13
cjs : {
18
14
format : 'cjs' ,
19
15
platform : 'node' ,
20
16
outdir : './lib/cjs' ,
21
- plugins : [ copyTypingsPlugin ] ,
17
+ plugins : [
18
+ copy ( {
19
+ assets : [ { from : [ './typings.d.ts' ] , to : [ './typings.d.ts' ] } ] ,
20
+ } ) ,
21
+ ] ,
22
22
} ,
23
23
esm : {
24
24
format : 'esm' ,
@@ -39,7 +39,9 @@ const config = {
39
39
} ) ;
40
40
} ,
41
41
} ,
42
- copyTypingsPlugin ,
42
+ copy ( {
43
+ assets : [ { from : [ './typings.d.ts' ] , to : [ './typings.d.mts' ] } ] ,
44
+ } ) ,
43
45
] ,
44
46
} ,
45
47
} ;
Original file line number Diff line number Diff line change 6
6
"main" : " ./lib/cjs/index.js" ,
7
7
"exports" : {
8
8
"." : {
9
- "require" : " ./lib/cjs/index.js" ,
9
+ "import" : {
10
+ "types" : " ./lib/esm/typings.d.mts" ,
10
11
"default" : " ./lib/esm/index.mjs"
12
+ },
13
+ "require" : {
14
+ "types" : " ./lib/cjs/typings.d.ts" ,
15
+ "default" : " ./lib/cjs/index.js"
16
+ }
11
17
}
12
18
},
13
19
"module" : " ./lib/esm/index.mjs" ,
26
32
" Tong Li"
27
33
],
28
34
"license" : " Apache-2.0" ,
29
- "types" : " ./typings.d.ts" ,
35
+ "types" : " ./lib/cjs/ typings.d.ts" ,
30
36
"files" : [
31
- " lib" ,
32
- " typings.d.ts"
37
+ " lib"
33
38
],
34
39
"scripts" : {
35
40
"prebuild" : " rm -rf lib" ,
You can’t perform that action at this time.
0 commit comments