Skip to content

Commit 9693e1b

Browse files
authored
Fix moduleResolution:node16 CommonJS compatibility (#577)
1 parent 354b5c2 commit 9693e1b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packages/runtime/package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44
"type": "module",
55
"exports": {
66
".": {
7-
"types": "./lib/index.d.ts",
7+
"types": {
8+
"import": "./lib/index.d.ts",
9+
"require": "./lib/index.d.cts",
10+
"default": "./lib/index.d.ts"
11+
},
812
"import": "./lib/index.js",
913
"require": "./lib/index.cjs",
1014
"default": "./lib/index.js"
@@ -29,7 +33,7 @@
2933
"scripts": {
3034
"test": "NODE_OPTIONS='--experimental-vm-modules' jest",
3135
"build:cjs": "esbuild --bundle --sourcemap --platform=node --target=node14 src/index.ts --minify --external:chalk --external:antlr4ts --outfile=lib/index.cjs",
32-
"build": "tsc && npm run build:cjs",
36+
"build": "tsc && npm run build:cjs && cp lib/index.d.ts lib/index.d.cts",
3337
"check": "tsc --noEmit",
3438
"watch": "tsc --watch --preserveWatchOutput"
3539
},

0 commit comments

Comments
 (0)