mirror of
https://github.com/wahyd4/vuepress.git
synced 2026-08-09 05:16:23 +10:00
feat: remove unnecessary check in moduleResolver.ts (#2068)
This commit is contained in:
@@ -212,19 +212,17 @@ class ModuleResolver {
|
||||
|
||||
if (req.startsWith('@')) {
|
||||
const pkg = resolveScopePackage(req)
|
||||
if (pkg) {
|
||||
// special handling for default org.
|
||||
if (this.org && pkg.org === this.org) {
|
||||
shortcut = pkg.name.startsWith(`${this.type}-`)
|
||||
? pkg.name.slice(this.typePrefixLength)
|
||||
: pkg.name
|
||||
name = `${this.scopePrefix}${shortcut}`
|
||||
} else {
|
||||
shortcut = this.getShortcut(pkg.name)
|
||||
name = `@${pkg.org}/${this.nonScopePrefix}${shortcut}`
|
||||
}
|
||||
shortcut = `@${pkg.org}/${shortcut}`
|
||||
// special handling for default org.
|
||||
if (this.org && pkg.org === this.org) {
|
||||
shortcut = pkg.name.startsWith(`${this.type}-`)
|
||||
? pkg.name.slice(this.typePrefixLength)
|
||||
: pkg.name
|
||||
name = `${this.scopePrefix}${shortcut}`
|
||||
} else {
|
||||
shortcut = this.getShortcut(pkg.name)
|
||||
name = `@${pkg.org}/${this.nonScopePrefix}${shortcut}`
|
||||
}
|
||||
shortcut = `@${pkg.org}/${shortcut}`
|
||||
} else {
|
||||
shortcut = this.getShortcut(req)
|
||||
name = `${this.nonScopePrefix}${shortcut}`
|
||||
|
||||
Reference in New Issue
Block a user