@@ -21,7 +21,8 @@ module.exports = {
2121 { name : 'view-encapsulation' , type : String , aliases : [ 've' ] } ,
2222 { name : 'change-detection' , type : String , aliases : [ 'cd' ] } ,
2323 { name : 'skip-import' , type : Boolean , default : false } ,
24- { name : 'module' , type : String , aliases : [ 'm' ] }
24+ { name : 'module' , type : String , aliases : [ 'm' ] } ,
25+ { name : 'export' , type : Boolean , default : false }
2526 ] ,
2627
2728 beforeInstall : function ( options ) {
@@ -161,7 +162,14 @@ module.exports = {
161162 if ( ! options . skipImport ) {
162163 returns . push (
163164 astUtils . addDeclarationToModule ( this . pathToModule , className , importPath )
164- . then ( change => change . apply ( NodeHost ) ) ) ;
165+ . then ( change => change . apply ( NodeHost ) )
166+ . then ( ( result ) => {
167+ if ( options . export ) {
168+ return astUtils . addExportToModule ( this . pathToModule , className , importPath )
169+ . then ( change => change . apply ( NodeHost ) ) ;
170+ }
171+ return result ;
172+ } ) ) ;
165173 this . _writeStatusToUI ( chalk . yellow , 'update' , path . relative ( this . project . root , this . pathToModule ) ) ;
166174 }
167175
0 commit comments