Skip to content

joshwooding/vite-plugin-react-docgen-typescript

Repository files navigation

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

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:

Option Type Description Default
tsconfigPath string Specify the location of the tsconfig.json to use. null
compilerOptions object Specify compiler options. Cannot be used with tsconfigPath null
setDisplayName boolean Set 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
typePropName string Specify the name of the property for docgen info prop type. type
exclude glob[] Glob patterns to ignore and not generate docgen information for. (Great for ignoring large icon libraries) []
include glob[] Glob patterns to generate docgen information for ['**/**.tsx']
fileSystemCache boolean/object Enables a persistent file-system cache. Configure with { enabled?: boolean; directory?: string }. false
EXPERIMENTAL_useWatchProgram boolean Enables an experimental watch mode to enable HMR support. warning: This may affect performance false
EXPERIMENTAL_useProjectService boolean Enables an experimental mode that uses the TS project service to enable HMR support. warning: This may affect performance false

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors