File tree 1 file changed +27
-27
lines changed
1 file changed +27
-27
lines changed Original file line number Diff line number Diff line change @@ -2,18 +2,18 @@ import { ComponentResolver } from '../types'
2
2
import { kebabCase } from '../utils'
3
3
4
4
export interface VarletUIResolverOptions {
5
- /**
6
- * import css along with components
7
- *
8
- * @default true
9
- */
10
- importCss ?: boolean
11
- /**
12
- * import less along with components
13
- *
14
- * @default false
15
- */
16
- importLess ?: boolean
5
+ /**
6
+ * import css along with components
7
+ *
8
+ * @default true
9
+ */
10
+ importCss ?: boolean
11
+ /**
12
+ * import less along with components
13
+ *
14
+ * @default false
15
+ */
16
+ importLess ?: boolean
17
17
}
18
18
19
19
/**
@@ -22,20 +22,20 @@ export interface VarletUIResolverOptions {
22
22
* @link https://github.com/haoziqaq/varlet
23
23
*/
24
24
export const VarletUIResolver = ( options : VarletUIResolverOptions = { } ) : ComponentResolver => ( name : string ) => {
25
- const {
26
- importCss = true ,
27
- importLess
28
- } = options
29
- if ( name . startsWith ( 'Var' ) ) {
30
- const partialName = name . slice ( 3 )
31
- return {
32
- importName : partialName ,
33
- path : '@varlet/ui/es' ,
34
- sideEffects : importLess
35
- ? `@varlet/ui/es/${ kebabCase ( partialName ) } /style/less.js`
36
- : importCss
37
- ? `@varlet/ui/es/${ kebabCase ( partialName ) } /style`
38
- : undefined
39
- }
25
+ const {
26
+ importCss = true ,
27
+ importLess,
28
+ } = options
29
+ if ( name . startsWith ( 'Var' ) ) {
30
+ const partialName = name . slice ( 3 )
31
+ return {
32
+ importName : partialName ,
33
+ path : '@varlet/ui/es' ,
34
+ sideEffects : importLess
35
+ ? `@varlet/ui/es/${ kebabCase ( partialName ) } /style/less.js`
36
+ : importCss
37
+ ? `@varlet/ui/es/${ kebabCase ( partialName ) } /style`
38
+ : undefined ,
40
39
}
40
+ }
41
41
}
You can’t perform that action at this time.
0 commit comments