Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(varlet-ui): support styleExtname option #740

Merged
merged 1 commit into from
May 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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