{
"projects": {
"default": "host-test-xxxxx"
},
"targets": {
"host-test-xxxxx": {
"hosting": {
"production": [
"production-xxxxx"
]
}
},
"host-test-dev": {
"hosting": {
"develop": [
"develop-xxxxx"
]
}
}
}
}
我的firebase.json是:
{
"hosting": [{
"target": "develop",
"public": "build",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
},
{
"target": "production",
"public": "build",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
]
}
目标当前设置为默认值,我在该项目中设置了firestore。我想创建一个文件,获取当前目标的配置,如下所示:
import * as firebase from 'firebase';
import 'firebase/firestore';
const firebaseConfig = {
apiKey: "$myAPIKEY",
projectId: "$myPROJECTID",
appId: "$myAPPID",
};
firebase.initializeApp(firebaseConfig);
export default firebase;