File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -7,12 +7,21 @@ async function getWebConfig() {
7
7
// $FIREBASE_WEBAPP_CONFIG can be either a JSON representation of FirebaseOptions or the path
8
8
// to a filename
9
9
if ( process . env . FIREBASE_WEBAPP_CONFIG ) {
10
- if ( process . env . FIREBASE_WEBAPP_CONFIG . startsWith ( "{" ) ) {
10
+ if ( process . env . FIREBASE_WEBAPP_CONFIG . startsWith ( "{\" " ) ) {
11
11
try {
12
12
configFromEnvironment = JSON . parse ( process . env . FIREBASE_WEBAPP_CONFIG ) ;
13
13
} catch ( e ) {
14
14
console . error ( "FIREBASE_WEBAPP_CONFIG could not be parsed." , e ) ;
15
15
}
16
+ } if ( process . env . FIREBASE_WEBAPP_CONFIG . startsWith ( "{" ) ) {
17
+ // TODO temporary
18
+ configFromEnvironment = Object . fromEntries (
19
+ process . env . FIREBASE_WEBAPP_CONFIG
20
+ . match ( / ^ { ( .+ ) } $ / ) [ 1 ]
21
+ . split ( ',' )
22
+ . map ( it => it . match ( "([^\:]+)\:(.+)" ) ?. slice ( 1 ) )
23
+ . filter ( it => it )
24
+ ) ;
16
25
} else {
17
26
const fileName = process . env . FIREBASE_WEBAPP_CONFIG ;
18
27
const fileURL = pathToFileURL ( isAbsolute ( fileName ) ? fileName : join ( process . cwd ( ) , fileName ) ) ;
You can’t perform that action at this time.
0 commit comments