Skip to content

Commit 6570e43

Browse files
committed
Add blurb about configuring TypeScript for ESM resolution (#1330)
Summary: Pull Request resolved: #1330 This has been tripping folks up a bit. Add a blurb to the package README to call it out. Reviewed By: cortinico Differential Revision: D47370333 fbshipit-source-id: f07b2e4d0e23865e3554c7aaf6ec77dff71a7423
1 parent 6628873 commit 6570e43

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

javascript/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,15 @@ node.free();
4141

4242
For better performance and smaller packages, WebAssembly is preferred to asm.js where available. `yoga-layout` tries to provide the right default using [export maps](https://webpack.js.org/guides/package-exports/#conditional-syntax) so that platforms which can take advantage of WebAssembly use it by default.
4343

44-
A specific entrypoint may be specified on platforms which do not understand export conditions.
44+
Different entrypoints are exposed to choose a flavor explicitly.
4545

4646
```ts
4747
import {loadYoga} from 'yoga-layout/wasm-async';
4848
```
4949

50+
## Using TypeScript
51+
52+
This package provides out-of-the-box TypeScript typings so long as `tsc` is configured to support ESM resolution. It is recommended to set `moduleResolution: 'bundler'` or `moduleResolution: node16` in your `tsconfig.json` according to your environment.
5053

5154
## Contributing
5255

0 commit comments

Comments
 (0)