typedoc-webpack-plugin
raw JSON → 1.1.4 verified Sat Apr 25 auth: no javascript abandoned
Runs TypeDoc documentation generation as a Webpack plugin. Latest version 1.1.4 (last released 2017) requires typedoc ^0.5.0 as peer dependency. It is an older, unmaintained plugin; consider using typedoc-plugin-webpack instead. It supports file/directory input, JSON output, and mirrors TypeDoc options.
Common errors
error TypeError: TypedocWebpackPlugin is not a constructor ↓
cause ESM import used or wrong export access.
fix
Use const TypedocWebpackPlugin = require('typedoc-webpack-plugin');
error Error: Cannot find module 'typedoc' ↓
cause Missing peer dependency typedoc.
fix
Run: npm install typedoc@0.5 --save-dev
Warnings
breaking Plugin is unmaintained; no updates since 2017. May not work with Webpack 5 or newer TypeDoc versions. ↓
fix Use typedoc-plugin-webpack instead.
deprecated TypeDoc peer dependency is ^0.5.0; later TypeDoc versions have breaking API changes. ↓
fix Pin TypeDoc to 0.5.x or migrate to alternative.
gotcha Options are passed directly to TypeDoc; not all TypeDoc options may be supported. ↓
fix Refer to TypeDoc 0.5 documentation.
Install
npm install typedoc-webpack-plugin yarn add typedoc-webpack-plugin pnpm add typedoc-webpack-plugin Imports
- TypedocWebpackPlugin wrong
import TypedocWebpackPlugin from 'typedoc-webpack-plugin';correctconst TypedocWebpackPlugin = require('typedoc-webpack-plugin'); - TypedocWebpackPlugin wrong
const { TypedocWebpackPlugin } = require('typedoc-webpack-plugin');correctconst TypedocWebpackPlugin = require('typedoc-webpack-plugin'); - Constructor usage wrong
new TypedocWebpackPlugin({...}, options)correctplugins: [new TypedocWebpackPlugin(options, input)]
Quickstart
const TypedocWebpackPlugin = require('typedoc-webpack-plugin');
module.exports = {
entry: './src/index.ts',
output: { path: './dist' },
resolve: { extensions: ['.ts', '.js'] },
module: { rules: [{ test: /\.ts$/, loader: 'ts-loader' }] },
plugins: [
new TypedocWebpackPlugin({
out: './docs',
module: 'commonjs',
target: 'es5',
exclude: '**/node_modules/**/*.*',
experimentalDecorators: true,
excludeExternals: true
}, './src')
]
};