Skip to content

Commit 16df156

Browse files
authoredApr 14, 2020
fix($shared-utils): fail to resolve markdown-it plugins (close #2286)(#2289)
1 parent e7f33d7 commit 16df156

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed
 

‎packages/@vuepress/shared-utils/src/moduleResolver.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -88,16 +88,15 @@ class ModuleResolver {
8888
this.allowedTypes = allowedTypes
8989
this.load = load
9090
this.cwd = cwd || process.cwd()
91+
this.typePrefixLength = type.length + 1
9192
if (org) {
9293
this.nonScopePrefix = `${org}-${type}-`
9394
this.scopePrefix = `@${org}/${type}-`
95+
this.prefixSlicePosition = this.typePrefixLength + org.length + 1
9496
} else {
9597
this.nonScopePrefix = `${type}-`
98+
this.prefixSlicePosition = this.typePrefixLength
9699
}
97-
this.typePrefixLength = type.length + 1
98-
/* - */
99-
this.prefixSlicePosition = this.typePrefixLength + org.length + 1
100-
/* @ */
101100
}
102101

103102
/**

0 commit comments

Comments
 (0)
Please sign in to comment.