From 5af82bb55fb40ab406296a179f735a55978a96f7 Mon Sep 17 00:00:00 2001 From: meteorlxy Date: Wed, 8 Apr 2020 14:48:52 +0800 Subject: [PATCH] fix($shared-utils): fail to resolve markdown-it plugins (close #2286) --- packages/@vuepress/shared-utils/src/moduleResolver.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/@vuepress/shared-utils/src/moduleResolver.ts b/packages/@vuepress/shared-utils/src/moduleResolver.ts index cf38380fe7..d6fe825f92 100644 --- a/packages/@vuepress/shared-utils/src/moduleResolver.ts +++ b/packages/@vuepress/shared-utils/src/moduleResolver.ts @@ -88,16 +88,15 @@ class ModuleResolver { this.allowedTypes = allowedTypes this.load = load this.cwd = cwd || process.cwd() + this.typePrefixLength = type.length + 1 if (org) { this.nonScopePrefix = `${org}-${type}-` this.scopePrefix = `@${org}/${type}-` + this.prefixSlicePosition = this.typePrefixLength + org.length + 1 } else { this.nonScopePrefix = `${type}-` + this.prefixSlicePosition = this.typePrefixLength } - this.typePrefixLength = type.length + 1 - /* - */ - this.prefixSlicePosition = this.typePrefixLength + org.length + 1 - /* @ */ } /**