@@ -21,7 +21,8 @@ module.exports = {
21
21
{ name : 'view-encapsulation' , type : String , aliases : [ 've' ] } ,
22
22
{ name : 'change-detection' , type : String , aliases : [ 'cd' ] } ,
23
23
{ 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 }
25
26
] ,
26
27
27
28
beforeInstall : function ( options ) {
@@ -161,7 +162,14 @@ module.exports = {
161
162
if ( ! options . skipImport ) {
162
163
returns . push (
163
164
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
+ } ) ) ;
165
173
this . _writeStatusToUI ( chalk . yellow , 'update' , path . relative ( this . project . root , this . pathToModule ) ) ;
166
174
}
167
175
0 commit comments