---
name: webpack-config-documenter
description: "A readable reference for an existing webpack config: what each entry, output setting, loader, and plugin does and why it is there, pitched at the reader you choose and ready to drop into the repo docs. Use when an existing webpack.config.js needs a plain-language reference doc for new team members or DevOps covering entry points, output, loaders, and plugins. Do not use for writing a new config, fixing a broken build, or tuning bundle size. Related topics: coding, webpack."
---

# Webpack Config Documenter

A readable reference for an existing webpack config: what each entry, output setting, loader, and plugin does and why it is there, pitched at the reader you choose and ready to drop into the repo docs.

## When to use

Use this skill when an existing webpack.config.js needs a plain-language reference doc for new team members or DevOps covering entry points, output, loaders, and plugins. Do not use it for writing a new config, fixing a broken build, or tuning bundle size.

## Workflow

1. Ask the user for each input listed below in a single message, skipping any they have already given. Where options are listed, offer them, but accept other answers too.
2. Read the whole config and state in one sentence what the build produces, which becomes the Overview.
3. Describe each entry point and the output settings, including hashing and public path, so a reader knows where every bundle lands.
4. Document each loader rule by the files it matches and the transformation it applies, in the order webpack runs them.
5. Explain each plugin's job and the non-default options that matter, leaving out defaults.
6. Add a Notes section for environment variables, development versus production differences, and unusual settings with their likely reason.
7. Trim or expand every section to the chosen detail level and return it in the requested format with nothing else.

## Inputs

- **The config** (longer free text)
- **Config file location** (free text, e.g. "./webpack.config.js")
- **Audience** (choose one: Front-end developer, DevOps engineer, New team member)
- **Detail level** (choose one: Brief, Detailed)
- **Include plugins overview** (choose one: Yes, No)
- **Include loaders overview** (choose one: Yes, No)
- **Output format** (choose one: Markdown, HTML)

## Output

A document in Markdown or HTML with sections Overview, Entry points, Output, Plugins and Loaders when requested, and Notes, each sized to the chosen detail level.

## Prompt template

Fill the inputs into this template and follow it as the full instruction.

### Webpack Config Documenter

Document the webpack configuration below so a reader can understand the build without opening the file.

- The config: {{The config}}
- Config file location: {{Config file location}}
- Audience: {{Audience}}
- Detail level: {{Detail level}}
- Include plugins overview: {{Include plugins overview}}
- Include loaders overview: {{Include loaders overview}}
- Output format: {{Output format}}

Read the config end to end before writing, so the overview describes what the build produces rather than listing keys. Open with an Overview: the mode, the targets, and the one sentence a newcomer needs. Then Entry points and Output, naming each entry and where its bundles land, including hashing or public path rules. When loaders are requested, describe each rule by what files it matches and what it turns them into, in the order webpack applies them (the last loader in a chain runs first, which surprises people). When plugins are requested, explain what each one adds to the build and the option values that matter, skipping defaults. Close with Notes: environment variables the config reads, anything that differs between development and production, and settings that look unusual, with the likely reason. Match the detail level: Brief is one or two lines per section, Detailed includes option-by-option notes. Return the document in the chosen format only, with no commentary around it.

## Pitfalls

- Restating option names as prose ('devtool is set to source-map') instead of saying what the setting means for the reader.
- Listing loaders in file order and missing that chained loaders run right to left, which misdescribes the pipeline.
- Documenting default values alongside real choices, which buries the three settings the team actually changed.
