TypeScript-friendly strategies for package.json subpath exports compatibility
I'm trying to bring proper ESM+CJS to Material UI, Base UI, and related projects. I'm using the `types-versions-wildcards` strategy to make sure the libraries work correctly under `node10` module resolution. However, I ran into an issue, and I'm wondering if this is a TypeScript limitation or if there is a workaround. Our source code layout looks slightly different than the example in this repo. Under the root directory, we have subdirectories with `index.js` (after transpilation), and these subpaths are exported in package.json as such: ```json ".": { "import": { "types": "./build/esm/index.d.ts", "default": "./build/esm/index.js" }, "require": { "types": "./build/cjs/index.d.ts", "default": "./build/cjs/index.js" } }, "./*": { "import": { "types": "./build/esm/*/index.d.ts", "default": "./build/esm/*/index.js" }, "require": { "types": "./build/cjs/*/index.d.ts", "default": "./build/cjs/*/index.js" } } ``` I couldn't find a way to configure `typesVersions` in a way that would make TS happy with both the root and subpath exports. `"*": { "*": ["build/cjs/*"] }` makes the subpaths unresolved, while `"*": { ".": ["build/cjs/index.d.ts"], "*": ["build/cjs/*/index.d.ts"] }` has problems with the root export. I created a minimal repro in https://github.com/michaldudak/attw-repro and I'd appreciate any help (and mentioning such a case in the ATTW docs).
This issue appears to be discussing a feature request or bug report related to the repository. Based on the content, it seems to be resolved. The issue was opened by michaldudak and has received 1 comments.