-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
parse firebase_config env variable in vite.config
- Loading branch information
1 parent
a358954
commit 4f8e2d7
Showing
4 changed files
with
9 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
import { initializeApp } from 'firebase/app'; | ||
import { initializeApp, getApps } from 'firebase/app'; | ||
import { initializeFirestore } from 'firebase/firestore'; | ||
import { refs } from './firebase.firestore'; | ||
import { browser } from '$app/environment'; | ||
import { env } from '@env'; | ||
import { initAnalytics } from './firebase.analytics'; | ||
import { browser } from '$app/environment'; | ||
|
||
export const app = initializeApp(env.FIREBASE_CONFIG); | ||
// Initialize Firebase | ||
export const app = getApps()[0] || initializeApp(process.env.FIREBASE_CONFIG); | ||
export const firestore = initializeFirestore(app, { | ||
experimentalAutoDetectLongPolling: browser, | ||
localCache: browser ? { kind: 'persistent' } : void 0 | ||
}); | ||
|
||
export const dbRefs = refs(firestore); | ||
|
||
initAnalytics(app); | ||
export const analytics = initAnalytics(app); | ||
export const dbRefs = refs(firestore); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const ssr = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters