Skip to content

Commit

Permalink
Add typesVersion for resolving all types using legacy moduleResolution
Browse files Browse the repository at this point in the history
When TS is set up to not use a `moduleResolution` of `node16` or `bundler` yet (like legacy `node`/`node10`), then TS would not look into `exports`.

There is `types`, but that only works when resolving the main index module, like `import from 'ember-cli-page-object'`, but all other submodules like `ember-cli-page-object/adapter` would fail to resolve to `types.d.ts`. 

This is removing `types` in favor of `typesVersions`, supporting the same wildcard-matching that `exports` does.
  • Loading branch information
simonihmig authored Jan 29, 2024
1 parent de24116 commit f66a516
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion addon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@
"types": "./types.d.ts"
}
},
"types": "types.d.ts",
"typesVersions": {
"*": {
"*": ["./types.d.ts"]
}
},
"files": [
"addon-main.js",
"dist",
Expand Down

0 comments on commit f66a516

Please sign in to comment.