{"library":"react-docgen-typescript-loader","title":"Webpack Loader for TypeScript React Component Docgen","description":"react-docgen-typescript-loader is a Webpack loader designed to extract documentation (docgen) information from TypeScript React components. This information, including component prop types, descriptions, and default values, is primarily utilized to populate dynamic documentation tables, especially within tools like Storybook's Info Addon or Docs Addon. The current stable version is 3.7.2. While there's no fixed release cadence, updates typically align with major changes in React, TypeScript, or Webpack. Its key differentiator is its specific focus on TypeScript components, offering robust type introspection to enrich component documentation automatically, reducing manual documentation effort for developers working in TypeScript-heavy React ecosystems.","language":"javascript","status":"active","last_verified":"Sun Apr 19","install":{"commands":["npm install react-docgen-typescript-loader"],"cli":null},"imports":["loader: 'react-docgen-typescript-loader'","loader: require.resolve('react-docgen-typescript-loader')"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"const path = require(\"path\");\n\nmodule.exports = (baseConfig, env, config) => {\n  config.module.rules.push({\n    test: /\\.tsx?$/,\n    include: path.resolve(__dirname, \"../src\"),\n    use: [\n      require.resolve(\"ts-loader\"),\n      {\n        loader: require.resolve(\"react-docgen-typescript-loader\"),\n        options: {\n          // Optional: specify a tsconfig.json file for better type resolution\n          // tsconfigPath: path.resolve(__dirname, '../tsconfig.json'),\n          // Optional: exclude files from being processed\n          // exclude: ['node_modules'],\n          // Optional: include files from being processed\n          // include: ['src'],\n        }\n      }\n    ]\n  });\n\n  // Required for Storybook to resolve .tsx files\n  config.resolve.extensions.push('.ts', '.tsx');\n\n  return config;\n};","lang":"javascript","description":"This configuration demonstrates how to integrate `react-docgen-typescript-loader` into a Storybook Webpack setup, ensuring it processes `.tsx` and `.ts` files after `ts-loader` to generate prop type documentation for components.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}