Skip to content

Commit c10d0e7

Browse files
authored
feat(antdv): add AntDesignVueResolverOptions support exclude component (#137)
1 parent 7f53b3c commit c10d0e7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/core/resolvers/antdv.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,12 @@ const matchComponents: IMatcher[] = [
151151
]
152152

153153
export interface AntDesignVueResolverOptions {
154+
/**
155+
* exclude components that do not require automatic import
156+
*
157+
* @default []
158+
*/
159+
exclude?: string[]
154160
/**
155161
* import style along with components
156162
*
@@ -230,7 +236,7 @@ export function AntDesignVueResolver(options: AntDesignVueResolverOptions = {}):
230236
}
231237
}
232238

233-
if (name.match(/^A[A-Z]/)) {
239+
if (name.match(/^A[A-Z]/) && !options?.exclude?.includes(name)) {
234240
const importName = name.slice(1)
235241
return {
236242
importName,

0 commit comments

Comments
 (0)