From 6570e43a83056c00af9b5d43daecac8c7522c530 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Wed, 12 Jul 2023 15:43:10 -0700 Subject: [PATCH] Add blurb about configuring TypeScript for ESM resolution (#1330) Summary: Pull Request resolved: https://github.com/facebook/yoga/pull/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 --- javascript/README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/javascript/README.md b/javascript/README.md index 87b07a2e..f8cd930a 100644 --- a/javascript/README.md +++ b/javascript/README.md @@ -41,12 +41,15 @@ node.free(); 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. -A specific entrypoint may be specified on platforms which do not understand export conditions. +Different entrypoints are exposed to choose a flavor explicitly. ```ts import {loadYoga} from 'yoga-layout/wasm-async'; ``` +## Using TypeScript + +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. ## Contributing