@@ -258,24 +258,33 @@ class ServerlessComopnent extends Component {
258
258
outputs . templateUrl = CONFIGS . templateUrl
259
259
}
260
260
261
- const deployTasks = [ this . deployFunction ( credentials , functionConf , regionList , outputs ) ]
261
+ let apigwOutputs
262
+ const functionOutputs = await this . deployFunction (
263
+ credentials ,
264
+ functionConf ,
265
+ regionList ,
266
+ outputs
267
+ )
262
268
// support apigatewayConf.isDisabled
263
269
if ( apigatewayConf . isDisabled !== true ) {
264
- deployTasks . push ( this . deployApigateway ( credentials , apigatewayConf , regionList , outputs ) )
270
+ apigwOutputs = await this . deployApigateway ( credentials , apigatewayConf , regionList , outputs )
265
271
} else {
266
272
this . state . apigwDisabled = true
267
273
}
268
- const [ functionOutputs , apigwOutputs = { } ] = await Promise . all ( deployTasks )
269
274
270
275
// optimize outputs for one region
271
276
if ( regionList . length === 1 ) {
272
277
const [ oneRegion ] = regionList
273
278
outputs . region = oneRegion
274
- outputs [ 'apigw' ] = apigwOutputs [ oneRegion ]
275
279
outputs [ 'scf' ] = functionOutputs [ oneRegion ]
280
+ if ( apigwOutputs ) {
281
+ outputs [ 'apigw' ] = apigwOutputs [ oneRegion ]
282
+ }
276
283
} else {
277
- outputs [ 'apigw' ] = apigwOutputs
278
284
outputs [ 'scf' ] = functionOutputs
285
+ if ( apigwOutputs ) {
286
+ outputs [ 'apigw' ] = apigwOutputs
287
+ }
279
288
}
280
289
281
290
// start deploy static cdn
0 commit comments