File tree Expand file tree Collapse file tree
core/temlpates/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,7 +18,11 @@ export class BarrelTemplate extends TemplateBase implements Template {
1818 ? this . vars . componentName
1919 : 'default'
2020 ) ,
21- t . identifier ( this . vars . componentName )
21+ t . identifier (
22+ config . exportType === 'named'
23+ ? this . vars . componentName
24+ : 'default'
25+ )
2226 ) ,
2327 ] ,
2428 t . stringLiteral ( `./${ this . vars . fileName } ` )
Original file line number Diff line number Diff line change @@ -81,28 +81,30 @@ describe('Component', () => {
8181 await runGenerator ( { } , { answers, type } ) ;
8282 } ) ;
8383
84- it ( 'should create component: ts/css/test (arrow/default)' , async ( ) => {
84+ it ( 'should create component: ts/css/test/barrel (arrow/default)' , async ( ) => {
8585 config . update ( {
8686 styles : 'css' ,
8787 typescript : true ,
8888 arrowFunction : true ,
8989 exportType : 'default' ,
9090 } ) ;
9191
92- answers . name = 'ts/css/test (arrow-fn)' ;
92+ answers . name = 'ts/css/test/barrel (arrow-fn)' ;
93+ answers . barrel = true ;
9394
9495 await runGenerator ( { } , { answers, type } ) ;
9596 } ) ;
9697
97- it ( 'should create component: js/css/test (arrow/exported)' , async ( ) => {
98+ it ( 'should create component: js/css/test/barrel (arrow/exported)' , async ( ) => {
9899 config . update ( {
99100 styles : 'css' ,
100101 arrowFunction : false ,
101102 jsxExt : false ,
102103 exportType : 'named' ,
103104 } ) ;
104105
105- answers . name = 'js/css/test (export-named)' ;
106+ answers . name = 'js/css/test/barrel (export-named)' ;
107+ answers . barrel = true ;
106108
107109 await runGenerator ( { } , { answers, type } ) ;
108110 } ) ;
You can’t perform that action at this time.
0 commit comments