@@ -9,7 +9,7 @@ import * as glob from "glob";
99
1010import { needProjectId } from "../projectUtils" ;
1111import { hostingConfig } from "../hosting/config" ;
12- import { listSites } from "../hosting/api" ;
12+ import { listDemoSites , listSites } from "../hosting/api" ;
1313import { getAppConfig , AppPlatform } from "../management/apps" ;
1414import { promptOnce } from "../prompt" ;
1515import { EmulatorInfo , Emulators , EMULATORS_SUPPORTED_BY_USE_EMULATOR } from "../emulator/types" ;
@@ -54,6 +54,7 @@ import { isDeepStrictEqual } from "util";
5454import { resolveProjectPath } from "../projectPath" ;
5555import { logger } from "../logger" ;
5656import { WebFrameworks } from "./frameworks" ;
57+ import { constructDefaultWebSetup } from "../fetchWebSetup" ;
5758
5859export { WebFrameworks } ;
5960
@@ -206,12 +207,16 @@ export async function prepareFrameworks(
206207 } ) ;
207208 let firebaseConfig = null ;
208209 if ( usesFirebaseJsSdk ) {
209- const sites = await listSites ( project ) ;
210+ const isDemoProject = Constants . isDemoProject ( project ) ;
211+
212+ const sites = isDemoProject ? listDemoSites ( project ) : await listSites ( project ) ;
210213 const selectedSite = sites . find ( ( it ) => it . name && it . name . split ( "/" ) . pop ( ) === site ) ;
211214 if ( selectedSite ) {
212215 const { appId } = selectedSite ;
213216 if ( appId ) {
214- firebaseConfig = await getAppConfig ( appId , AppPlatform . WEB ) ;
217+ firebaseConfig = isDemoProject
218+ ? constructDefaultWebSetup ( project )
219+ : await getAppConfig ( appId , AppPlatform . WEB ) ;
215220 firebaseDefaults ||= { } ;
216221 firebaseDefaults . config = firebaseConfig ;
217222 } else {
0 commit comments