@@ -4,7 +4,7 @@ import * as inquirer from 'inquirer';
4
4
import { shortSiteName } from '../common' ;
5
5
import { getFirebaseTools } from '../firebaseTools' ;
6
6
import { FEATURES , FirebaseApp , FirebaseHostingSite , FirebaseProject , PROJECT_TYPE , WorkspaceProject , featureOptions } from '../interfaces' ;
7
- import { shortAppId } from '../utils' ;
7
+ import { isSSRApp , isUniversalApp , shortAppId } from '../utils' ;
8
8
9
9
// eslint-disable-next-line @typescript-eslint/no-var-requires
10
10
inquirer . registerPrompt ( 'autocomplete' , require ( 'inquirer-autocomplete-prompt' ) ) ;
@@ -251,13 +251,19 @@ const ALLOWED_SSR_REGIONS = [
251
251
] ;
252
252
253
253
export const projectTypePrompt = async ( project : WorkspaceProject , name : string ) => {
254
- const buildTarget = `${ name } :build:${ project . architect ?. build ?. defaultConfiguration || 'production' } ` ;
255
- const { ssrRegion } = await inquirer . prompt ( {
256
- type : 'list' ,
257
- name : 'ssrRegion' ,
258
- choices : ALLOWED_SSR_REGIONS ,
259
- message : 'In which region would you like to host server-side content?' ,
260
- default : DEFAULT_REGION ,
261
- } ) as { ssrRegion : string } ;
262
- return { projectType : PROJECT_TYPE . WebFrameworks , ssrRegion, buildTarget } ;
254
+ const buildTarget = [ `${ name } :build:production` , `${ name } :build:development` ] ;
255
+ const serveTarget = isUniversalApp ( project ) ?
256
+ [ `${ name } :serve-ssr:production` , `${ name } :serve-ssr:development` ] :
257
+ [ `${ name } :serve:production` , `${ name } :serve:development` ] ;
258
+ if ( isUniversalApp ( project ) || isSSRApp ( project ) ) {
259
+ const { ssrRegion } = await inquirer . prompt ( {
260
+ type : 'list' ,
261
+ name : 'ssrRegion' ,
262
+ choices : ALLOWED_SSR_REGIONS ,
263
+ message : 'In which region would you like to host server-side content?' ,
264
+ default : DEFAULT_REGION ,
265
+ } ) as { ssrRegion : string } ;
266
+ return { projectType : PROJECT_TYPE . WebFrameworks , ssrRegion, buildTarget, serveTarget } ;
267
+ }
268
+ return { projectType : PROJECT_TYPE . WebFrameworks , buildTarget, serveTarget } ;
263
269
} ;
0 commit comments