@@ -21,14 +21,15 @@ const combine = {
2121 grid : [ 'grid' , 'grid-item' ] ,
2222 layout : [ 'row' , 'col' ] ,
2323 form : [ 'form' , 'form-item' ] ,
24+ qrcode : [ 'qrcode' , 'qrcode/components/qrcode-canvas' , 'qrcode/components/qrcode-status' ] ,
2425} ;
2526
2627const resolveCwd = ( ...args ) => {
2728 args . unshift ( process . cwd ( ) ) ;
2829 return path . join ( ...args ) ;
2930} ;
3031
31- const findFilePath = ( componentName ) => resolveCwd ( `src/${ componentName } /${ componentName } .less` ) ;
32+ const findFilePath = ( componentPath , componentName ) => resolveCwd ( `src/${ componentPath } /${ componentName } .less` ) ;
3233
3334const getAllComponentName = async ( dirPath ) => {
3435 const items = await fs . promises . readdir ( dirPath , { withFileTypes : true } ) ;
@@ -42,10 +43,10 @@ const generateCssVariables = async (componentName) => {
4243
4344 if ( combine [ componentName ] ) {
4445 combine [ componentName ] . forEach ( ( item ) => {
45- lessPath . push ( findFilePath ( item ) ) ;
46+ lessPath . push ( findFilePath ( item , item . includes ( '/' ) ? item . split ( '/' ) . pop ( ) : item ) ) ;
4647 } ) ;
4748 } else {
48- lessPath . push ( findFilePath ( componentName ) ) ;
49+ lessPath . push ( findFilePath ( componentName , componentName ) ) ;
4950 }
5051
5152 const validPaths = lessPath . filter ( ( item ) => fs . existsSync ( item ) ) ;
0 commit comments