tsconfigPath

  • Type: string
  • Default: 'tsconfig.json'

Configure a custom tsconfig.json file path to use, can be a relative or absolute path.

Purpose

The tsconfig.json configuration file affects the following behaviors of Rsbuild:

Example

The value of source.tsconfigPath can be set to a relative or an absolute path. Relative path will be resolved relative to the project root directory.

  • Relative path example:
export default {
  source: {
    tsconfigPath: './tsconfig.custom.json',
  },
};
  • Absolute path example:
import path from 'node:path';

export default {
  source: {
    tsconfigPath: path.join(__dirname, 'tsconfig.custom.json'),
  },
};
ON THIS PAGE