From 8ed910158166cb1dcf72bd0d64527bc268c01761 Mon Sep 17 00:00:00 2001 From: Jimmy Date: Sun, 18 Feb 2024 22:17:42 +0800 Subject: [PATCH] feat(varlet-ui): support `styleExtname` option --- src/core/resolvers/varlet-ui.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/core/resolvers/varlet-ui.ts b/src/core/resolvers/varlet-ui.ts index 0b1b2a67..9a4bb2d2 100644 --- a/src/core/resolvers/varlet-ui.ts +++ b/src/core/resolvers/varlet-ui.ts @@ -17,6 +17,13 @@ export interface VarletUIResolverOptions { */ importStyle?: boolean | 'css' | 'less' + /** + * style entry file extname + * + * @default '.mjs' + */ + styleExtname?: string + /** * auto import for directives * @@ -50,6 +57,7 @@ export function getResolved(name: string, options: VarletUIResolverOptions): Com importStyle = 'css', importCss = true, importLess, + styleExtname = '.mjs', autoImport = false, version = 'vue3', } = options @@ -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 {