Skip to content

Webpack5: how to get module parents/dependants (or deps graph) from loader #11432

@wclr

Description

@wclr

In one of my loaders, I need to know parents/dependants that the current module (handled by loader) was requested by. For this in webpack4 I used a hacky way to do this with access to this._module.reasons, but in webpack 5 reasons prop does not exist on _module object (which is a too deprecated prop). So how the actual task of getting requested parents from within loader may be accomplished in Webpack 5?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions