Skip to content

"Writing a loader": document why loaders can't be simple functions #2549

Open
@danburzo

Description

@danburzo

Feature to document

A note to clarify why loaders can't be simple functions, as per webpack/webpack#119, webpack/webpack#698 will save would-be loader authors a lot of grief.

I've spent some time digging through the docs for an explanation of why something that, at first impression, should work — the ability to specify a loader as a function — does indeed not work.

(This is complicated by the fact that mini-css-extract-plugin seems — but in fact, does not — use such a pattern)

A short note on why you can't just send functions as loaders would have been very helpful on the Writing a loader page.

Author(s)

N/A

Additional information

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions