Skip to content

Commit e254da8

Browse files
committed
fix: use custom resolver after fs
1 parent 1a5fe0f commit e254da8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/context.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,18 +86,18 @@ export class Context {
8686
}
8787

8888
findComponent(name: string, excludePaths: string[] = []) {
89+
// resolve from fs
90+
const info = this._componentNameMap[name]
91+
if (info && !excludePaths.includes(info.path) && !excludePaths.includes(info.path.slice(1)))
92+
return info
93+
8994
// custom resolvers
9095
for (const resolver of this._resolvers) {
9196
const path = resolver(name)
9297
if (path)
9398
return { name, path }
9499
}
95100

96-
// resolve from fs
97-
const info = this._componentNameMap[name]
98-
if (info && !excludePaths.includes(info.path) && !excludePaths.includes(info.path.slice(1)))
99-
return info
100-
101101
return undefined
102102
}
103103

0 commit comments

Comments
 (0)