Skip to content

Commit c0e66f3

Browse files
authored
feat(varlet-ui): support styleExtname option (#740)
1 parent 027128c commit c0e66f3

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/core/resolvers/varlet-ui.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@ export interface VarletUIResolverOptions {
1717
*/
1818
importStyle?: boolean | 'css' | 'less'
1919

20+
/**
21+
* style entry file extname
22+
*
23+
* @default '.mjs'
24+
*/
25+
styleExtname?: string
26+
2027
/**
2128
* auto import for directives
2229
*
@@ -50,6 +57,7 @@ export function getResolved(name: string, options: VarletUIResolverOptions): Com
5057
importStyle = 'css',
5158
importCss = true,
5259
importLess,
60+
styleExtname = '.mjs',
5361
autoImport = false,
5462
version = 'vue3',
5563
} = options
@@ -61,7 +69,7 @@ export function getResolved(name: string, options: VarletUIResolverOptions): Com
6169
if (importStyle === 'less' || importLess)
6270
sideEffects.push(`${path}/es/${kebabCase(name)}/style/less`)
6371
else
64-
sideEffects.push(`${path}/es/${kebabCase(name)}/style/index`)
72+
sideEffects.push(`${path}/es/${kebabCase(name)}/style/index${styleExtname}`)
6573
}
6674

6775
return {

0 commit comments

Comments
 (0)