File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -15,8 +15,10 @@ type Server = typeof import('./angular/index.js') |
1515import type { Request } from 'firebase-functions/v2/https' ;
1616import type { Response } from 'express' ;
1717
18+ import { isUsingFirebaseJsSdk } from './utils.js'
19+
1820const dirname = process . env . __FIREBASE_FRAMEWORKS_ENTRY__ ;
19- const usingFirebaseJsSdk = ! ! process . env . __FIREBASE_DEFAULTS__ ;
21+ const usingFirebaseJsSdk = await isUsingFirebaseJsSdk ( ) ;
2022const basename = usingFirebaseJsSdk ? 'firebase-aware' : 'index' ;
2123
2224// .env isn't parsed for Cloud Functions discovery during deploy, handle undefined
Original file line number Diff line number Diff line change 1+ export async function isUsingFirebaseJsSdk ( ) {
2+ if ( ! process . env . __FIREBASE_DEFAULTS__ ) return false ;
3+
4+ try {
5+ await import ( 'firebase/app' ) ;
6+
7+ return true
8+ } catch ( e ) {
9+ return false ;
10+ }
11+ }
You can’t perform that action at this time.
0 commit comments