Skip to content

Commit f6da6af

Browse files
authored
feat(element-ui): add exclude option (#508)
1 parent cb8f932 commit f6da6af

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/core/resolvers/element-ui.ts

+7
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ export interface ElementUiResolverOptions {
1111
* @default 'css'
1212
*/
1313
importStyle?: boolean | 'css' | 'sass'
14+
15+
/**
16+
* exclude component name, if match do not resolve the name
17+
*/
18+
exclude?: RegExp
1419
}
1520

1621
function getSideEffects(
@@ -46,6 +51,8 @@ export function ElementUiResolver(options: ElementUiResolverOptions = {}): Compo
4651
return {
4752
type: 'component',
4853
resolve: (name: string) => {
54+
if (options.exclude && name.match(options.exclude))
55+
return
4956
if (/^El[A-Z]/.test(name)) {
5057
const compName = name.slice(2)
5158
const partialName = kebabCase(compName)

0 commit comments

Comments
 (0)