Skip to content

Commit

Permalink
feat: support isPluginExists for plugin manager
Browse files Browse the repository at this point in the history
  • Loading branch information
caohuilin committed Jan 7, 2025
1 parent 41b5218 commit 0a494e3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .changeset/modern-bulldogs-cross.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@modern-js/plugin-v2': patch
---

feat: support isPluginExists for plugin manager

feat: 插件支持 isPluginExists 方法
1 change: 1 addition & 0 deletions packages/toolkit/plugin-v2/src/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,5 +171,6 @@ export function createPluginManager(): PluginManager {
getPlugins,
addPlugins,
clear,
isPluginExists: (name: string) => plugins.has(name),
};
}
1 change: 1 addition & 0 deletions packages/toolkit/plugin-v2/src/types/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,5 @@ export type PluginManager = {
getPlugins: () => Plugin[];
addPlugins: (plugins: Array<Plugin | Falsy>) => void;
clear: () => void;
isPluginExist: (name: string) => boolean;
};

0 comments on commit 0a494e3

Please sign in to comment.