@farmfe/plugin-dts
Rust plugin that emits .d.ts files for matched TypeScript modules during a Farm build.
Installation
javascript
npm install @farmfe/plugin-dtsjavascript
yarn add @farmfe/plugin-dtsjavascript
pnpm add @farmfe/plugin-dtsUsage
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.
Farm