From 77b80ce7fdcfa2c24869c9c31b4c50672b277c9e Mon Sep 17 00:00:00 2001 From: Hristo Terezov Date: Mon, 11 May 2026 17:34:51 -0500 Subject: [PATCH] fix(package): correct subpath export resolution for all module types The previous wildcard subpath export mapped `./*` to `./dist/*` without extensions, so bundlers and Node's ESM resolver could not locate the actual files for imports like `@jitsi/js-utils/random`. The modules in this package use different layouts, so a single wildcard cannot cover all of them: - Directory modules (avatar, browser-detection, jitsi-local-storage, random, transport) expose an `index` file, so map `./*` to `./dist/*/index.{js,d.ts}`. - `json` is a single file at the package root, so add an explicit `./json` export pointing at `./dist/json.{js,d.ts}`. - `polyfills/` exposes individual files rather than a barrel, so add a dedicated `./polyfills/*` wildcard that maps each name to `./dist/polyfills/*.{js,d.ts}`. --- package.json | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index f36fed6..c7cb183 100644 --- a/package.json +++ b/package.json @@ -55,9 +55,17 @@ "types": "./dist/index.d.ts", "default": "./dist/index.js" }, + "./json": { + "types": "./dist/json.d.ts", + "default": "./dist/json.js" + }, + "./polyfills/*": { + "types": "./dist/polyfills/*.d.ts", + "default": "./dist/polyfills/*.js" + }, "./*": { - "types": "./dist/*", - "default": "./dist/*" + "types": "./dist/*/index.d.ts", + "default": "./dist/*/index.js" } }, "files": [