Skip to content

Commit

Permalink
feat(varlet-ui): support styleExtname option (#740)
Browse files Browse the repository at this point in the history
  • Loading branch information
RSS1102 committed May 1, 2024
1 parent 027128c commit c0e66f3
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/core/resolvers/varlet-ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ export interface VarletUIResolverOptions {
*/
importStyle?: boolean | 'css' | 'less'

/**
* style entry file extname
*
* @default '.mjs'
*/
styleExtname?: string

/**
* auto import for directives
*
Expand Down Expand Up @@ -50,6 +57,7 @@ export function getResolved(name: string, options: VarletUIResolverOptions): Com
importStyle = 'css',
importCss = true,
importLess,
styleExtname = '.mjs',
autoImport = false,
version = 'vue3',
} = options
Expand All @@ -61,7 +69,7 @@ export function getResolved(name: string, options: VarletUIResolverOptions): Com
if (importStyle === 'less' || importLess)
sideEffects.push(`${path}/es/${kebabCase(name)}/style/less`)
else
sideEffects.push(`${path}/es/${kebabCase(name)}/style/index`)
sideEffects.push(`${path}/es/${kebabCase(name)}/style/index${styleExtname}`)
}

return {
Expand Down

0 comments on commit c0e66f3

Please sign in to comment.