Skip to content

Commit 4492a5d

Browse files
authored
feat: support isPluginExists for plugin manager (#6702)
1 parent fccc80d commit 4492a5d

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

.changeset/modern-bulldogs-cross.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@modern-js/plugin-v2': patch
3+
---
4+
5+
feat: support isPluginExists for plugin manager
6+
7+
feat: 插件支持 isPluginExists 方法

packages/toolkit/plugin-v2/src/manager.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,5 +171,6 @@ export function createPluginManager(): PluginManager {
171171
getPlugins,
172172
addPlugins,
173173
clear,
174+
isPluginExists: (name: string) => plugins.has(name),
174175
};
175176
}

packages/toolkit/plugin-v2/src/types/plugin.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,5 @@ export type PluginManager = {
4848
getPlugins: () => Plugin[];
4949
addPlugins: (plugins: Array<Plugin | Falsy>) => void;
5050
clear: () => void;
51+
isPluginExists: (name: string) => boolean;
5152
};

0 commit comments

Comments
 (0)