@joshwooding/vite-plugin-react-docgen-typescript

March 25, 2026 · View on GitHub

npm Code style: Prettier

A vite plugin to inject react typescript docgen information

 

Usage

import reactDocgenTypescript from "@joshwooding/vite-plugin-react-docgen-typescript";

export default {
  plugins: [reactDocgenTypescript()],
};

Options

This plugins support all parser options from react-docgen-typescript and all of the following options:

OptionTypeDescriptionDefault
tsconfigPathstringSpecify the location of the tsconfig.json to use.null
compilerOptionsobjectSpecify compiler options. Cannot be used with tsconfigPathnull
setDisplayNamebooleanSet the components' display name. If you want to set display names yourself or are using another plugin to do this, you should disable this option.true
typePropNamestringSpecify the name of the property for docgen info prop type.type
excludeglob[]Glob patterns to ignore and not generate docgen information for. (Great for ignoring large icon libraries)[]
includeglob[]Glob patterns to generate docgen information for['**/**.tsx']
fileSystemCacheboolean/objectEnables a persistent file-system cache. Configure with { enabled?: boolean; directory?: string }.false
EXPERIMENTAL_useWatchProgrambooleanEnables an experimental watch mode to enable HMR support. warning: This may affect performancefalse
EXPERIMENTAL_useProjectServicebooleanEnables an experimental mode that uses the TS project service to enable HMR support. warning: This may affect performancefalse

When fileSystemCache is enabled without a custom directory, cache entries are stored in node_modules/.cache/vite-plugin-react-docgen-typescript.