Skip to content

metro-plugin-typescript

[!CAUTION]

@rnx-kit/metro-plugin-typescript has been deprecated

This plugin was meant to allow users to perform both type checking and bundling at the same time. However, users experience slowdowns and inconsistent errors when this plugin is enabled. We are now recommending you to upgrade to TypeScript 7 and run type checking first instead.

Build npm version

@rnx-kit/metro-plugin-typescript adds type checking to Metro.

const { makeMetroConfig } = require("@rnx-kit/metro-config");
const { TypeScriptPlugin } = require("@rnx-kit/metro-plugin-typescript");
module.exports = makeMetroConfig({
serializer: {
experimentalSerializerHook: TypeScriptPlugin(),
},
});
Key Type Default Description
throwOnError boolean false Whether to throw when errors are found.