From 16df156429a0ad85c8bedb6776d55380db2d6fb2 Mon Sep 17 00:00:00 2001 From: meteorlxy Date: Tue, 14 Apr 2020 10:22:24 +0800 Subject: [PATCH] fix($shared-utils): fail to resolve markdown-it plugins (close #2286)(#2289) --- 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 - /* @ */ } /**