0.0.10 • Published 1 year ago

@rnx-kit/typescript-react-native-compiler v0.0.10

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@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