From 220eafbda5f1ba1a383d5b5a3a488be461afc69b Mon Sep 17 00:00:00 2001 From: chenos Date: Mon, 18 Mar 2024 15:55:10 +0800 Subject: [PATCH] fix(client): plugin aliases --- packages/core/client/src/application/PluginManager.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/core/client/src/application/PluginManager.ts b/packages/core/client/src/application/PluginManager.ts index 001f09e3c..159313c19 100644 --- a/packages/core/client/src/application/PluginManager.ts +++ b/packages/core/client/src/application/PluginManager.ts @@ -2,7 +2,7 @@ import type { Application } from './Application'; import type { Plugin } from './Plugin'; import { getPlugins } from './utils/remotePlugins'; -export type PluginOptions = { name?: string; config?: T }; +export type PluginOptions = { name?: string; packageName?: string; config?: T }; export type PluginType = typeof Plugin | [typeof Plugin, PluginOptions]; export type PluginData = { name: string; @@ -63,6 +63,11 @@ export class PluginManager { if (opts.name) { this.pluginsAliases[opts.name] = instance; } + + if (opts.packageName) { + this.pluginsAliases[opts.packageName] = instance; + } + await instance.afterAdd(); }