tools.tsChecker
- Type:
Object | Function - Default:
By default, the @rsbuild/plugin-type-check is enabled for type checking. You can use output.disableTsChecker config to disable it.
Example
Object Type
When the value of tsChecker is an object, it will be deeply merged with the default configuration.
Function Type
When the value of tsChecker is a function, the default configuration will be passed as the first argument. You can directly modify the configuration object or return an object as the final configuration.
Please refer to @rsbuild/plugin-type-check for more details.
TypeScript 7+ Support
tools.tsChecker supports the native checker included in TypeScript 7+. This capability is provided by ts-checker-rspack-plugin, which is integrated by @rsbuild/plugin-type-check, and can reduce type-checking time on large projects.
Install TypeScript >= 7.0.0 to enable tsgo automatically:
When tsgo is enabled and typescript.typescriptPath is set manually, it must point to an absolute TypeScript 7+ typescript/package.json path or the legacy @typescript/native-preview/package.json path.
The
@typescript/native-previewpath is kept only for compatibility. New setups should use TypeScript 7+ from the standardtypescriptpackage.
For supported options and limitations, please refer to ts-checker-rspack-plugin - TypeScript 7+ support.