Skip to content

API - Clarify Plugins Structure and Flow #940

Closed
@aight8

Description

@aight8

The page especially missing:

  1. Description of all class instance properties

  2. A flow of the plugins - a) where you can hook and where it is in the flow b) when webpack do what internally. I found this chinese website which go the direction I mean: https://github.com/liangklfangl/webpack-compiler-and-compilation

  3. This is difficult to understand:

Plugin Interfaces
There are two types of plugin interfaces.

Timing based

sync (default): As seen above. Use return.
async: Last parameter is a callback. Signature: function(err, result)
parallel: The handlers are invoked parallel (async).

Return value

not bailing (default): No return value.
bailing: The handlers are invoked in order until one handler returns something.
parallel bailing: The handlers are invoked in parallel (async). The first returned value (by order) is significant.
waterfall: Each handler gets the result value of the last handler as an argument.
  1. Show ES6 class variant of the plugin architecture beside the prototyped one (encourage plugin developer to use classes)

  2. Explain entirely what seal means in webpack

  3. compilation(c: Compilation, params: Object)

A Compilation is created. A plugin can use this to obtain a reference to the Compilation object. The params object contains useful references

I LOVE useful references. But what kind of?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions