Skip to content

Document webpack change: DefinePlugin takes care of module invalidation when values have changed #4724

@webpack-bot

Description

@webpack-bot

A pull request by @sokra was merged and maintainers requested a documentation change.

See pull request: webpack/webpack#12896


The options of the DefinePlugin no longer have to be covered by build dependencies

What kind of change does this PR introduce?
feature

Did you add tests for your changes?
yes

Does this PR introduce a breaking change?
no

What needs to be documented once your changes are merged?

  • The constant options of the DefinePlugin do not have to be covered by build dependencies.
    • but for the DefinePlugin.runtimeValue generator function build dependencies need to be used
  • DefinePlugin.runtimeValue has now an options argument as second argument
    • options.fileDependencies: string[] list of files the function depends on
    • options.contextDependencies: string[] list of directories the function depends on
    • options.missingDependencies: string[] list of not existing files the function depends on
    • options.buildDependencies: string[] list of build dependencies the function depends on
    • options.version: string | () => string version of the function

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions