@@ -588,6 +588,7 @@ export default class MiniPlugin {
588
588
path : pagePath ,
589
589
isNative,
590
590
stylePath : isNative ? this . getStylePath ( pagePath ) : undefined ,
591
+ templatePath : isNative ? this . getTemplatePath ( pagePath ) : undefined ,
591
592
skeletonPath : isNative ? this . getSkeletonExtraPath ( pagePath ) : undefined ,
592
593
} ;
593
594
} ) ,
@@ -690,10 +691,10 @@ export default class MiniPlugin {
690
691
}
691
692
this . addEntry ( path . resolve ( __dirname , '..' , 'template/custom-wrapper' ) , 'custom-wrapper' , META_TYPE . STATIC ) ;
692
693
693
- const resolveComponentStyleEntry = ( name : string , stylePaths : string [ ] ) => {
694
+ const resolveComponentStyleEntry = ( name : string , stylePaths : string [ ] , ext = this . options . fileType . style ) => {
694
695
for ( const stylePath of stylePaths ) {
695
696
if ( fs . existsSync ( stylePath ) ) {
696
- this . addEntry ( stylePath , this . getTargetFilePath ( name , this . options . fileType . style ) , META_TYPE . NORMAL ) ;
697
+ this . addEntry ( stylePath , this . getTargetFilePath ( name , ext ) , META_TYPE . NORMAL ) ;
697
698
break ;
698
699
}
699
700
}
@@ -709,12 +710,10 @@ export default class MiniPlugin {
709
710
this . addEntry ( item . templatePath , this . getTemplatePath ( item . name ) , META_TYPE . NORMAL ) ;
710
711
}
711
712
712
- if ( item . skeletonPath ) {
713
- if ( item . skeletonPath . template ) {
714
- this . addEntry ( item . skeletonPath . template , this . getTargetFilePath ( item . name , `${ this . options . fileType . skeletonMidExt } ${ this . options . fileType . templ } ` ) , META_TYPE . NORMAL ) ;
715
- }
713
+ if ( item . skeletonPath && item . skeletonPath . template && fs . existsSync ( item . skeletonPath . template ) ) {
714
+ this . addEntry ( item . skeletonPath . template , this . getTargetFilePath ( item . name , `${ this . options . fileType . skeletonMidExt } ${ this . options . fileType . templ } ` ) , META_TYPE . NORMAL ) ;
716
715
if ( item . skeletonPath . style ) {
717
- resolveComponentStyleEntry ( this . getTargetFilePath ( item . name , this . options . fileType . skeletonMidExt ) , item . skeletonPath . style ) ;
716
+ resolveComponentStyleEntry ( item . name , item . skeletonPath . style , ` ${ this . options . fileType . skeletonMidExt } ${ this . options . fileType . style } ` ) ;
718
717
}
719
718
}
720
719
} else {
0 commit comments