File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -111,10 +111,14 @@ export default function afterEffectsJsx(options = { wrap: false }) {
111111 } ,
112112 } ) ;
113113
114- // wrap entire code in get() method
115114 magicString
115+ // add return statements for exports
116+ . append ( `\nreturn { ${ exports . join ( ', ' ) } }` )
117+ // indent everything before wrapping
118+ . indent ( )
119+ // wrap entire code in get() method
116120 . prepend ( 'get() {\n' )
117- . append ( `\nreturn { ${ exports . join ( ',\n\t' ) } }\n}` ) ;
121+ . append ( '\n}' ) ;
118122 } else {
119123 // Remove non exported nodes and convert
120124 // to object property style compatible syntax
@@ -183,7 +187,7 @@ export default function afterEffectsJsx(options = { wrap: false }) {
183187 // Log exports to the terminal
184188 console . log ( `Exported JSX:` , exports ) ;
185189 // Sanitize output and wrap in braces
186- magicString . trim ( ) . prepend ( '{\n' ) . append ( '\n}' ) . indent ( ) . trimStart ( ) ;
190+ magicString . trim ( ) . indent ( ) . prepend ( '{\n' ) . append ( '\n}' ) . trimStart ( ) ;
187191 // Replace the files code with modified
188192 bundle [ file ] . code = magicString . toString ( ) ;
189193 }
You can’t perform that action at this time.
0 commit comments