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 - /* @ */ } /**