From 22bbc31ebe9bad8138857532f22a386e5a970289 Mon Sep 17 00:00:00 2001 From: jimmiezhang Date: Fri, 10 Jun 2022 10:47:57 +0800 Subject: [PATCH] feat: plugin decleare, path priority over package (#105) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 张荣杰 --- src/plugin/base.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugin/base.ts b/src/plugin/base.ts index 84be67b..6b37798 100644 --- a/src/plugin/base.ts +++ b/src/plugin/base.ts @@ -12,7 +12,7 @@ export class BasePlugin implements Plugin { constructor(name: string, configItem: PluginConfigItem) { this.name = name; let importPath = configItem.path ?? ''; - if (configItem.package) { + if (!importPath && configItem.package) { importPath = path.resolve(require.resolve(`${configItem.package}/package.json`), '..'); } if (!importPath) {