Angular firebase 应用中的警告 "It looks like you're using the development build of the Firebase JS SDK"

Warning "It looks like you're using the development build of the Firebase JS SDK" in Angular firebase app

我在我的 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>';

我的应用程序模块如下所示。

import {AngularFireModule} from '@angular/fire';
import {AngularFireAuthModule} from '@angular/fire/auth';

imports:[
   ...
    AngularFireModule.initializeApp(environment.firebaseConfig),
    AngularFireAuthModule,
]

我想在我的 angular 项目中停止此警告。

终于找到解决方法了

This is Wrong Way to import firebase

import {auth} from 'firebase';

And This is Correct Way to import firebase

import * as firebase from 'firebase/app';