diff --git a/bin/build.sh b/bin/build.sh index 019169a..ea06406 100755 --- a/bin/build.sh +++ b/bin/build.sh @@ -59,7 +59,7 @@ cp lib_web/rregex_bg.wasm.d.ts lib/rregex.wasm.d.ts cp lib_cf/cf.mjs lib/cf.mjs cp lib_nodejs/rregex.js lib/commonjs.cjs -cp lib_nodejs/rregex.d.ts lib/commonjs.d.ts +cp lib_nodejs/rregex.d.ts lib/commonjs.d.cts cp lib_no_modules/rregex.js lib/standalone.js cp lib_no_modules/rregex.d.ts lib/standalone.d.ts diff --git a/package.json b/package.json index 6865e56..2f9fd71 100644 --- a/package.json +++ b/package.json @@ -5,9 +5,26 @@ "private": false, "type": "module", "main": "./lib/commonjs.cjs", + "types": "./lib/commonjs.d.cts", "module": "./lib/esm.mjs", "browser": "./lib/web.js", - "types": "./lib/types.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "types": "./lib/esm.d.ts", + "default": "./lib/esm.mjs" + }, + "require": { + "types": "./lib/commonjs.d.cts", + "default": "./lib/commonjs.cjs" + }, + "browser": { + "types": "./lib/web.d.ts", + "default": "./lib/web.js" + } + } + }, "publishConfig": { "provenance": true },