File tree Expand file tree Collapse file tree 4 files changed +22
-6
lines changed Expand file tree Collapse file tree 4 files changed +22
-6
lines changed Original file line number Diff line number Diff line change 7
7
"scripts" : {
8
8
"start" : " tsc -w" ,
9
9
"prebuild" : " rimraf dist" ,
10
- "build" : " tsc" ,
11
- "postbuild" : " npm-prepare-dist -s postinstall -s prepare" ,
10
+ "build" : " tsc && tsc -p tsconfig-cjs.json " ,
11
+ "postbuild" : " npm-prepare-dist -s postinstall -s prepare && yarn fix-paths " ,
12
12
"tsc" : " tsc" ,
13
13
"demo" : " ts-node demo" ,
14
14
"lint" : " eslint ./src/**/**/* --fix" ,
15
15
"test" : " jest" ,
16
+ "fix-paths" : " yarn json -I -f ./dist/package.json -e \" this.module='./esm/index.js';this.main='./cjs/index.js';this.types='./cjs/index.d.ts'\" " ,
16
17
"postinstall" : " yarn husky install" ,
17
18
"publish:next" : " yarn && yarn build && yarn test --coverage true && npm publish --folder dist --tag beta" ,
18
19
"postversion" : " git push && git push --follow-tags" ,
40
41
"husky" : " ^8.0.1" ,
41
42
"jest" : " ^29.1.2" ,
42
43
"jest-fetch-mock" : " ^3.0.3" ,
44
+ "json" : " ^11.0.0" ,
43
45
"npm-prepare-dist" : " ^0.4.1" ,
44
46
"prettier" : " ^2.7.1" ,
45
47
"pretty-quick" : " ^3.1.3" ,
Original file line number Diff line number Diff line change
1
+ {
2
+ "extends" : " ./tsconfig.json" ,
3
+ "compilerOptions" : {
4
+ "module" : " CommonJS" ,
5
+ "outDir" : " ./dist/cjs"
6
+ }
7
+ }
Original file line number Diff line number Diff line change 1
1
{
2
2
"compilerOptions" : {
3
- "target" : " es2017 " ,
3
+ "target" : " es2015 " ,
4
4
"lib" : [" dom" ],
5
5
"types" : [" node" , " jest" ],
6
6
"baseUrl" : " ./src" ,
7
7
"esModuleInterop" : true ,
8
- "module" : " commonjs" ,
8
+ "module" : " esnext" ,
9
+ "moduleResolution" : " Node" ,
9
10
"strictNullChecks" : false ,
11
+ "allowSyntheticDefaultImports" : true ,
12
+ "forceConsistentCasingInFileNames" : true ,
10
13
"sourceMap" : false ,
11
- "outDir" : " ./dist" ,
14
+ "outDir" : " ./dist/esm " ,
12
15
"strict" : true ,
13
16
"declaration" : true ,
14
17
"pretty" : true ,
15
18
"skipLibCheck" : true ,
16
- "resolveJsonModule" : true ,
17
19
"alwaysStrict" : true ,
18
20
"noImplicitAny" : true ,
19
21
"noImplicitReturns" : true
Original file line number Diff line number Diff line change @@ -2369,6 +2369,11 @@ json5@^2.2.1:
2369
2369
resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.1.tgz#655d50ed1e6f95ad1a3caababd2b0efda10b395c"
2370
2370
integrity sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==
2371
2371
2372
+ json@^11.0.0 :
2373
+ version "11.0.0"
2374
+ resolved "https://registry.yarnpkg.com/json/-/json-11.0.0.tgz#2e84493134e2f42c131165aa22a124df38b3a3ee"
2375
+ integrity sha512-N/ITv3Yw9Za8cGxuQqSqrq6RHnlaHWZkAFavcfpH/R52522c26EbihMxnY7A1chxfXJ4d+cEFIsyTgfi9GihrA==
2376
+
2372
2377
kleur@^3.0.3 :
2373
2378
version "3.0.3"
2374
2379
resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e"
You can’t perform that action at this time.
0 commit comments