Skip to content

docs: use defaults table for mode-specific configuration options#8175

Closed
shivxmsharma wants to merge 1 commit intowebpack:mainfrom
shivxmsharma:docs/mode-defaults-table
Closed

docs: use defaults table for mode-specific configuration options#8175
shivxmsharma wants to merge 1 commit intowebpack:mainfrom
shivxmsharma:docs/mode-defaults-table

Conversation

@shivxmsharma
Copy link
Copy Markdown
Contributor

Closes #6356

Summary

The documentation currently describes mode-specific configuration defaults using inconsistent inline text (e.g., "enabled in production mode and disabled elsewise"). This makes it hard to quickly compare what the default is for each mode.

This PR introduces a standardized "defaults table" pattern across all configuration options that have different defaults depending on the mode setting. It also documents this pattern in the Writer's Guide so future contributors can follow the same format.

What kind of change does this PR introduce?

docs

Did you add tests for your changes?

No — this is a documentation-only change with no code changes.

Does this PR introduce a breaking change?

No.

If relevant, what needs to be documented once your changes are merged or what have you already documented?

The following options now use a defaults table instead of inline text:

  • optimization.mdx: checkWasmTypes, concatenateModules, emitOnErrors, avoidEntryIife, flagIncludedChunks, innerGraph, mangleExports, minimize, nodeEnv, realContentHash, sideEffects, usedExports
  • output.mdx: pathinfo
  • cache.mdx: cache
  • performance.mdx: hints

All default values were verified against webpack/lib/config/defaults.js.

The Writer's Guide has been updated to document the new pattern so future contributors know to use it.

Use of AI

I used Claude assistant to help research the correct default values from the webpack source code (webpack/lib/config/defaults.js) and to plan which pages needed updates. All changes were reviewed and applied manually by me.

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 7, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
webpack-js-org Ready Ready Preview, Comment Apr 7, 2026 9:18am

Request Review

@shivxmsharma
Copy link
Copy Markdown
Contributor Author

@alexander-akait Can you give a feedback here?

@alexander-akait
Copy link
Copy Markdown
Member

@shivxmsharma #6356 (comment), we need to replace these things everywhere, not only in one place

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Proposal: Update writer's guide for "Configuration defaults and types" to support listing different defaults for production/development

2 participants