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 Go Support
tools.tsChecker supports enabling TypeScript Go for type checking. This experimental capability is provided by ts-checker-rspack-plugin, which is integrated by @rsbuild/plugin-type-check, and can reduce type-checking time by about 5-10x.
Install TypeScript 7.0 RC to enable TypeScript Go automatically:
You can also install @typescript/native-preview and set typescript.tsgo to true:
When tsgo is enabled and typescript.typescriptPath is set manually, it must point to an absolute typescript/package.json path from TypeScript 7+ or @typescript/native-preview/package.json.
The
@typescript/native-previewusage is deprecated and kept only for compatibility. We recommend installingtypescript@rcto usetsgo.
For supported options and limitations, please refer to ts-checker-rspack-plugin - TypeScript Go support.