Open Rulexec opened 2 years ago
Hello. I have three plugins:
A
B
C
They tap some hook with same stage in the following order:
stage
A, B, C
Then inside https://github.com/webpack/tapable/blob/9d647f86ddb2930c6e24950a1edd2778453e92a1/lib/Hook.js#L136 they got position incorrectly as:
B, A, C
It happens because current logic looks like:
before
if (before.size > 0)
taps
B, A
Also it's will be good to throw exception if circular dependency is detected.
Hello. I have three plugins:
A
depends onB
B
depends onC
C
They tap some hook with same
stage
in the following order:A, B, C
Then inside https://github.com/webpack/tapable/blob/9d647f86ddb2930c6e24950a1edd2778453e92a1/lib/Hook.js#L136 they got position incorrectly as:
B, A, C
It happens because current logic looks like:
A
, no taps, just addB
,B
hasbefore
, soif (before.size > 0)
allows to skipA
and be inserted in the start oftaps
(e.g. order now isB, A
)C
to the top, since it has nobefore
rules