Skip to content

Commit cdea036

Browse files
fanhaoyuanantfu
andauthored
feat(antdv): add antdv icons resolve options. (#89)
Co-authored-by: Anthony Fu <[email protected]>
1 parent 25293ba commit cdea036

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/resolvers/antdv.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,14 @@ export interface AntDesignVueResolverOptions {
179179
* @default false
180180
*/
181181
importLess?: boolean
182+
/**
183+
* resolve `ant-design-vue' icons
184+
*
185+
* requires package `@ant-design/icons-vue`
186+
*
187+
* @default false
188+
*/
189+
resolveIcons?: boolean
182190
}
183191

184192
const getStyleDir = (compName: string): string => {
@@ -217,6 +225,13 @@ const getSideEffects: (
217225
export const AntDesignVueResolver
218226
= (options: AntDesignVueResolverOptions = {}): ComponentResolver =>
219227
(name: string) => {
228+
if (options.resolveIcons && name.match(/(Outlined|Filled|TwoTone)$/)) {
229+
return {
230+
importName: name,
231+
path: '@ant-design/icons-vue',
232+
}
233+
}
234+
220235
if (name.match(/^A[A-Z]/)) {
221236
const importName = name.slice(1)
222237
return {

0 commit comments

Comments
 (0)