【发布时间】:2020-09-24 22:22:12
【问题描述】:
我在我的 Angular 项目中使用 Angular Fire sdk。但它会触发以下警告。我搜索了这个问题并得到了答案。但这些答案不适用于 Angular 项目。
It looks like you're using the development build of the Firebase JS SDK.
When deploying Firebase apps to production, it is advisable to only import
the individual SDK components you intend to use.
For the module builds, these are available in the following manner
(replace <PACKAGE> with the name of a component - i.e. auth, database, etc):
CommonJS Modules:
const firebase = require('firebase/app');
require('firebase/<PACKAGE>');
ES Modules:
import firebase from 'firebase/app';
import 'firebase/<PACKAGE>';
Typescript:
import * as firebase from 'firebase/app';
import 'firebase/<PACKAGE>';
- Warning: It looks like you're using the development build of the Firebase JS SDK
- How to stop the warning: It looks like you're using the development build of the Firebase JS SDK?
- Firebase JS SDK warning while load application in browser (angular v5)
- How to avoid Firebase warning that I’m using the development build?
我的应用模块如下所示。
import {AngularFireModule} from '@angular/fire';
import {AngularFireAuthModule} from '@angular/fire/auth';
imports:[
...
AngularFireModule.initializeApp(environment.firebaseConfig),
AngularFireAuthModule,
]
我想在我的 Angular 项目中停止这个警告。
【问题讨论】:
-
您确定是您使用 firebase 导入的唯一文件吗?我设法删除了该警告,只是按照我正在使用 firebase 的任何文件中的建议写入
标签: angular firebase configuration angularfire2