Skip to content

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

@caseyjhol

Description

@caseyjhol

The current writer's guide suggests writing defaults as follows:

configuration.example.option

string = 'none': 'none' | 'development' | 'production'

Where = 'none' means that the default value is 'none' for the given option.

However, many options have 3 possible defaults depending on whether mode is set to none, production, or development. It's also difficult to decipher at times.

Proposal: use a "defaults" table instead.

optimization.moduleIds

boolean: false string: 'natural' | 'named' | 'deterministic' | 'size'

Mode Default
'production' 'deterministic'
'development' 'named'
'none' 'natural'

Example:
image

If an option has the same default for all modes, we could simplify it like so:

optimization.mangleWasmImports

boolean

Default
false

Example:
image


This makes it easy to see at a glance what the defaults are for every option.

Related:
#2080, #2302

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions