rnx-kit/packages/typescript-react-native-com...
Tommy Nguyen 9f24106cda
docs: automate removal of badges from READMEs (#2324)
2023-04-14 08:24:28 +02:00
..
CHANGELOG.md RELEASING: Releasing 4 package(s) (#2092) 2023-01-11 12:02:51 +01:00
README.md docs: automate removal of badges from READMEs (#2324) 2023-04-14 08:24:28 +02:00

README.md

@rnx-kit/typescript-react-native-compiler

Build npm version

@rnx-kit/typescript-react-native-compiler is the TypeScript compiler tsc with a custom module resolver for react-native projects.

🛑 Deprecated 🛑

This tool has been deprecated in favor of using tsc >= 4.7 with the moduleSuffixes compiler option.

You may continue to use it, but it will be removed in a future release.

Synopsis

This package extends TypeScript, adding the concept of a platform to tsc. When resolving modules, the platform is used to find platform-extension files such as foo.ios.ts and foo.native.ts. The platform is also used to map react-native module references to out-of-tree platforms such as react-native-windows and react-native-macos.

This package exports a new command-line tool: rn-tsc. It is a drop-in replacement for tsc with a few additional command-line parameters.

Example Commands

yarn run rn-tsc --platform ios --platformExtensions mobile,native
yarn run rn-tsc --platform macos --platformExtensions native --disableReactNativePackageSubstitution

Run a normal build without using the custom module resolver:

yarn run rn-tsc

Get a full listing of all command-line parameters:

yarn run rn-tsc --help