Skip to content

Commit

Permalink
Add moduleResolution bundler to FAQ answer (#337)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattpocock authored Sep 5, 2024
1 parent 1acf586 commit 9cca185
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,7 @@ Here are some behaviors that may look like bugs, but aren't.
* A method and a function property of the same type behave differently.
* Methods are always bivariant in their argument, while function properties are contravariant in their argument under `strictFunctionTypes`. More discussion [here](https://github.com/microsoft/TypeScript/pull/18654).
* Export maps aren't respected.
* TypeScript's support for export maps is recent, and requires `moduleResolution` be set to `node16` or `nodenext` to be respected.
* TypeScript's support for export maps is recent, and requires `moduleResolution` be set to `node16`, `nodenext` or `bundler` to be respected.
* A default import of a commonjs module with a default in a esm file doesn't seem to be the default export of that module when `module` is `node16` or `nodenext`.
* TypeScript is exposing `node`'s behavior here - when a esm module default imports a commonjs module, that whole commonjs module is made available as the default import. If you then want the actual default member of that module, you'll need to access the `default` member of that import. Refer to the [node documentation](https://nodejs.org/api/esm.html#commonjs-namespaces) for more information.

Expand Down

0 comments on commit 9cca185

Please sign in to comment.