Skip to main content
This guide walks through running webpack-doc-kit on your local machine to generate Markdown and HTML documentation from webpack’s TypeScript type definitions.
webpack must be checked out at the exact commit pinned in HEAD_COMMIT (214f361891d8f51f41bafb2e760cb3240d6014be). Using a different commit may produce docs that don’t match what CI expects, and the docs-check workflow will reject them.
1

Clone the repository

Clone webpack-doc-kit and enter the project directory.
git clone https://github.com/webpack/webpack-doc-kit.git
cd webpack-doc-kit
2

Checkout webpack at the pinned commit

webpack-doc-kit reads type definitions from a local webpack/ directory. Read the pinned commit SHA from HEAD_COMMIT and check out that exact revision.
git clone https://github.com/webpack/webpack.git webpack
git -C webpack checkout $(cat HEAD_COMMIT)
After this step your working tree should look like:
webpack-doc-kit/
├── webpack/          # checked out at the pinned commit
├── generate-md.mjs
├── plugins/
├── HEAD_COMMIT
└── package.json
3

Install dependencies

Install all npm dependencies using npm ci to reproduce the exact versions recorded in the lockfile.
npm ci
This installs runtime dependencies including typedoc, typedoc-plugin-markdown, @node-core/doc-kit, webpack, and semver, as well as dev dependencies for linting and formatting.
4

Generate Markdown

Run the generate-docs script to invoke TypeDoc and produce Markdown output.
npm run generate-docs
Internally this runs:
node generate-md.mjs
TypeDoc reads webpack/types.d.ts, runs the typedoc-plugin-markdown, plugins/processor.mjs, and plugins/theme/index.mjs plugins, and writes Markdown files to pages/v5.x/.
After generation, inspect the pages/v5.x/ directory to review the produced Markdown. The entry point is pages/v5.x/index.md and the type map used by the HTML build is at pages/v5.x/type-map.json.
5

Build HTML output

Run the build script to generate Markdown and then convert it to HTML in one step.
npm run build
This runs both stages in sequence:
npm run generate-docs && npm run build-html
The build-html script calls @node-core/doc-kit:
doc-kit generate -t web -i ./pages/v5.x/**/*.md --type-map ./pages/v5.x/type-map.json -o out
The final HTML output is written to the out/ directory. Open out/index.html in a browser to preview the generated documentation site.

Available scripts

ScriptDescription
npm run generate-docsGenerate Markdown from webpack types
npm run build-htmlConvert Markdown to HTML
npm run buildGenerate docs and build HTML
npm run lintRun ESLint
npm run format:checkCheck Prettier formatting

What runs in CI

On every pull request, the ci.yml workflow:
  1. Installs dependencies and runs npm run lint && npm run format:check
  2. Checks out webpack at the commit in HEAD_COMMIT, runs npm run generate-docs, and verifies that the pages/ directory has no uncommitted changes
If pages/ is out of date, CI will print a diff and fail. Run npm run generate-docs locally and commit the updated files before pushing.

Build docs developers (and LLMs) love