Skip to content

Commit

Permalink
fix: plugin circular error (#6569)
Browse files Browse the repository at this point in the history
  • Loading branch information
caohuilin authored Nov 26, 2024
1 parent 192f82e commit cd2bc69
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/toolkit/plugin-v2/src/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ export function createPluginManager(): PluginManager {
dependencies.get(plugin)!.post.set(dependency, { name: dependency });
} else if (type === 'use') {
// 'use' plugins are added to the 'pre' order if not already in 'post'
if (!dependencies.get(plugin)!.post.has(dependency)) {
if (
!dependencies.get(plugin)!.post.has(dependency) &&
!dependencies.get(dependency)!.pre.has(plugin)
) {
dependencies
.get(plugin)!
.pre.set(dependency, { name: dependency, isUse: true });
Expand Down

0 comments on commit cd2bc69

Please sign in to comment.