跳到主要内容
FarmFarm
Version: 2.x(最新)
本页目录

@farmfe/plugin-dts

Rust plugin that emits .d.ts files for matched TypeScript modules during a Farm build.

Installation

javascript
npm install @farmfe/plugin-dts
javascript
yarn add @farmfe/plugin-dts
javascript
pnpm add @farmfe/plugin-dts

Usage

ts
import { defineConfig } from "@farmfe/core";
import dts from "@farmfe/plugin-dts";

export default defineConfig({
  plugins: [
    dts({
      include: [".(ts|tsx)$"],
      exclude: ["node_modules/"],
    }),
  ],
});

Options

  • include?: string[] — regular expression strings for source modules to process. Defaults to [".(ts|tsx)$"].
  • exclude?: string[] — regular expression strings for modules to skip. Defaults to ["node_modules/"].

The plugin writes .d.ts next to the matched module path in the emitted resources and rewrites import paths to .d.ts when they resolve through Farm aliases.

100%

Drag or pinch to explore. Keyboard: + / − zoom, arrows pan, 0 resets, Esc closes.