Skip to content

Commit f6da6af

Browse files
authored
feat(element-ui): add exclude option (unplugin#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

Lines changed: 7 additions & 0 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy