Rsbuild Types

This section describes some of the type definitions provided by the Rsbuild.

RsbuildInstance

The type of the Rsbuild instance.

import type { RsbuildInstance } from '@rsbuild/core';

let rsbuild: RsbuildInstance;

Context

The type of the context property in the Rsbuild instance.

import type { Context } from '@rsbuild/core';

const context: Context = rsbuild.context;

RsbuildPlugin

The type of Rsbuild plugin.

import type { RsbuildPlugin } from '@rsbuild/core';

const myPlugin: RsbuildPlugin = {
  name: 'my-plugin',
  setup() {},
};

RsbuildTarget

The type of build target.

import type { RsbuildTarget } from '@rsbuild/core';

CreateRsbuildOptions

The param type of createRsbuild method.

import type { CreateRsbuildOptions } from '@rsbuild/core';